?
Solved

Tiff File Compression

Posted on 2008-10-06
6
Medium Priority
?
1,801 Views
Last Modified: 2013-12-17
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);
0
Comment
Question by:Rajasii
  • 2
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22650591
0
 

Author Comment

by:Rajasii
ID: 22656911
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.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22657060
Did you look here too?
http://www.bobpowell.net/onebit.htm

If you did, I have no more ideas
0
 

Accepted Solution

by:
Rajasii earned 0 total points
ID: 22657969
Thanks, for your work on the same. I also tried the same activity, it will change the color of the layer not the color property.

Finally I got the solution, By setting the image quality with JPEG pixel format for the tiff image, the size get reduced.

Issue
ImageCodecInfo ici = getCodecForstring("TIFF");

Solution.
ImageCodecInfo ici = getCodecForstring("JPEG");

by changing the parameter, my issue got solved.




0
 

Expert Comment

by:sindhureddy
ID: 32862012
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
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question