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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Convert RGB TIFF to TIFF G4
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

JanN

5 Posts

Posted - Oct 30 2012 :  08:59:24  Show Profile  Reply
Hi,

I already could build TIFF G4 files out of JPEG files. But somehow my code doesn't work in this particular case. I have an RGB TIFF file and want to convert it to BW. But whatever I do, it seems there is no difference between input and output file.

I tried two approaches:


Tiff.IO.LoadFromFile(inputfile, ioTIFF);
Tiff.IO.Params.TIFF_Compression := TIOTIFFCompression.ioTIFF_G4FAX;
Tiff.IO.Params.TIFF_PhotometInterpret := ioTIFF_BLACKISZERO;
Tiff.IO.Params.BitsPerSample := 1;
Tiff.IO.Params.SamplesPerPixel := 1;
Tiff.IO.Params.ImageIndex := i-1;
Tiff.IO.SaveToFileTIFF(outputfile)


Tiff.IO.LoadFromFile(inputfile, ioTIFF);
Tiff.Proc.ConvertToBW_FloydSteinberg;
Tiff.IO.SaveToFileTIFF(outputfile)


Is there anything wrong with my code? Could it be the original TIFF file which causes problems?

Regards,
Jan

w2m

USA
1990 Posts

Posted - Oct 30 2012 :  09:51:39  Show Profile  Reply
I tested your code here and found that the both approaches worked as expected. Send me your tif file and I'll test it with your image.


William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

JanN

5 Posts

Posted - Oct 30 2012 :  10:25:14  Show Profile  Reply
William, thank you very much for your support. It seems I had an error in my code which led to a wrong output file.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: