Problem with compression

Discussions about image processing and document imaging.
Post Reply
kparker
Posts: 5
Joined: Fri Feb 08, 2008 8:38 pm

Problem with compression

Post by kparker » Fri Jun 26, 2009 8:48 pm

Loic,

I'm having a problem with converting LZW TIFF images into CCITT 4 .

Here is the code I'm using:

Code: Select all

string imgPath = @"C:\Multipage.TIF";
axGdViewer1.DisplayFromFile(imgPath);
for (int i = 0; i < axGdViewer1.PageCount; i++)
            {   axImaging1.SetNativeImage(axImaging1.CreateClonedImage(axGdViewer1.GetNativeImage()));
                
                axImaging1.SaveAsTIFF("c:\\Single_page_" + (i+1) + ".tif", TifCompression.CompressionCCITT4); 
                axGdViewer1.DisplayNextFrame();
            }
The problem is that the saved TIFFs (Single_page_1.tif, ...) are all still have LZW compression.

Am I missing something?

Thanks,

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Problem with compression

Post by Loïc » Mon Jun 29, 2009 10:03 am

Hi,

You are probably trying to compress in ccitt4 image which are not bitonal (black & white).

Just add:

Code: Select all

axImaging1.ConvertTo1bpp();
After:

Code: Select all

   {   axImaging1.SetNativeImage(axImaging1.CreateClonedImage(axGdViewer1.GetNativeImage()));
With best regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest