Link to home
Start Free TrialLog in
Avatar of Rajasii
Rajasii

asked on

Tiff File Compression

The below shown code I used to set the "CompressionCCITT4" for Tiff Image, while generating the code, I am getting the error message called "Invalid Parameter".

Rectify the error provide the alternate solution for the same.

ImageCodecInfo ici = getCodecForstring("TIFF");
Encoder myEncoder = Encoder.Compression;
EncoderParameters myEncoderParameters = new EncoderParameters(1);
EncoderParameter myEncoderParameter = new EncoderParameter(myEncoder, (long)EncoderValue.CompressionCCITT4);
myEncoderParameters.Param[0] = myEncoderParameter;

_img.Save(sSavePath, ici, myEncoderParameters);
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Avatar of Rajasii
Rajasii

ASKER

I have tried the same for past 3 weeks, hope there is some bug with the compression type.

I change the color to black & white of tiff image. It changes only the color not the property.

due to this I was unable to set the EncoderValue.CompressionCCITT4 type.

provide the solution for the same.

thanks.
Did you look here too?
http://www.bobpowell.net/onebit.htm

If you did, I have no more ideas
ASKER CERTIFIED SOLUTION
Avatar of Rajasii
Rajasii

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I tried using this above solution but I couldnot save multipage tiff when I set it to JPEG pixel format. Please let me know if there is any other way to reduce the tiff file size