Solved

Tiff File Compression

Posted on 2008-10-06
6
1,779 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now