Save as Tiff : LZW

Discussions about image processing and document imaging.
Post Reply
mattewan
Posts: 33
Joined: Fri Apr 03, 2009 5:58 pm

Save as Tiff : LZW

Post by mattewan » Tue May 05, 2009 11:26 am

Hello,

I know this question has been asked before but im also getting the same problem.

Basically, im opening an image, then drawing another image into the first image, then trying to save it as group4 tiff, but i always get lzw.

Here is the code im using:

to insert image:

Code: Select all

imaging.DrawGdPictureImage(TempImage, ImageID, LeftPos, TopPos, pWidth, pHeight, GdPicture.InterpolationMode.InterpolationModeDefault)
to save:

Code: Select all

imaging.SaveAsTIFF(ImageID, OutputFile, GdPicture.TiffCompression.TiffCompressionCCITT4)
The original Image is group4, and the image im inserting into the document is group 4, but when i save, its a colour lzw:
LZW,1 Row per strip, 24Bpp, 200dpi

I have tried both 6.2.9 & 6.2.10 both do the same thing

Am i doing something wrong or is this a bug

Thank you

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

Re: Save as Tiff : LZW

Post by Loïc » Tue May 05, 2009 11:43 am

Hi,

CCITT4 & CCITT3 compression schemes are designed for bitonal image only.

After the call to DrawGdPictureImage() your image is converted to true color. So, just convert your image to 1bpp before saving it as TIFF.

IE:

Code: Select all

Imaging.ConvertTo1Bpp(ImageID)
imaging.SaveAsTIFF(ImageID, OutputFile, GdPicture.TiffCompression.TiffCompressionCCITT4)
Hope this helps.

Loïc

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 0 guests