ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Convert JPEG to compressed TIFF

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
JanN Posted - Oct 16 2012 : 02:41:33
Hi,

I have several JPEGs which have to be merged into one compressed black/white TIFF file. Unfortunately I cannot make it work with at least one file.

First try produced uncompressed file:

Tiff.IO.LoadFromBuffer(@ImageData[1], Length(ImageData), ioJPEG);
Tiff.IO.Params.TIFF_Compression := TIOTIFFCompression.ioTIFF_G4FAX;
Tiff.IO.SaveToFileTIFF(ImageFile);

Second try produces smaller but corrupt file (page looks strange):

Tiff.IO.LoadFromBuffer(@ImageData[1], Length(ImageData), ioJPEG);
Tiff.IO.Params.TIFF_Compression := TIOTIFFCompression.ioTIFF_G4FAX;
Tiff.IO.Params.BitsPerSample := 1;
Tiff.IO.Params.SamplesPerPixel := 1;
Tiff.IO.SaveToFileTIFF(ImageFile);

Any thoughts?

Regards,
Jan
2   L A T E S T    R E P L I E S    (Newest First)
JanN Posted - Oct 17 2012 : 13:06:03
Thank you very much. Option no. 1 did the job. :)
fab Posted - Oct 17 2012 : 11:22:35
Hi,
you have to specify the pixel format (black/white). You have two options:

1) set TIFF_PhotometInterpret (photometric interpretation):
Tiff.IO.Params.TIFF_PhotometInterpret := ioTIFF_BLACKISZERO;


2) convert your image to black/white (there are other options to convert to B/W, for example, dithering, threshold, etc..):
Tiff.IEBitmap.PixelFormat := ie1g;