Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Saving TIFF with CCITT4 compression with single strip!

259 views
Skip to first unread message

Los@discussions.microsoft.com Corne Los

unread,
Aug 17, 2009, 8:03:01 AM8/17/09
to
After installing Windows 7 the Tiff images that my C# program produces are
not longer encoded in a single strip.
Does anybody knwo how to force the tiff encoder to save the image data in
one strip?

This is the (C#) code I am currently using:

ImageCodecInfo tiffCodecInfo = GetEncoderInfo("image/tiff");
EncoderParameters myEncoderParameters = new
EncoderParameters(2);

// Save the bitmap as a TIFF file with CCITT group4 compression.
myEncoderParameters.Param[0] = new
EncoderParameter(System.Drawing.Imaging.Encoder.Compression,
(long)EncoderValue.CompressionCCITT4);
myEncoderParameters.Param[1] = new
EncoderParameter(System.Drawing.Imaging.Encoder.ColorDepth, 1L);

image.Save(source, tiffCodecInfo, myEncoderParameters);

Tamas Demjen

unread,
Aug 18, 2009, 9:13:08 PM8/18/09
to
Corne Los wrote:
> After installing Windows 7 the Tiff images that my C# program produces are
> not longer encoded in a single strip.

Apparently Microsoft doesn't provide enough control over the TIFF generated.

I'm sure Tifflib can do what you want, and some people have successfully
used it from C#:
http://blog.bee-eee.com/2008/03/12/c-writing-out-a-tiff-file-using-libtiff/

Tifflib is free, even for commercial use:
http://www.epsiia.com/licenses/libtiff.html

It was designed to be used from C, and requires some getting used to.

Tom

0 new messages