Solved

Tiff File Compression

Posted on 2008-10-06
6
1,785 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Studio npm 1 39
Get sourcecode path 14 61
Excel Web Add-in Where is Visual Basic used 9 79
ASP.NET VB code for check and insert in a table 4 45
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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