Image quality
-
One simple way is to change the resolution using Bitmap.SetResolution() method to a less value.
Regards:rose:
-
You can use the Quality encoder parameter, which works only with the JPEG encoder. Here's how to specify a quality level when saving an image:
//Get all the image encoders and find the one for the JPEG format
ImageCodecInfo[] codecs=ImageCodecInfo.GetImageEncoders();
ImageCodecInfo codec = null;
foreach(ImageCodecInfo c in codecs)
{
if(c.MimeType=="image/jpeg")
{
codec=c;
break;
}
}//Create a list of encoder parameters with space for a single entry
EncoderParameters encoderParams=new EncoderParams(1);
//Create a parameter to pass to the codec, with the category "Quality" and
//the desired quality value (where 100 is 100% quality)
EncoderParameter encoderParam=new EncoderParameter(Encoder.Quality, 90L);
//Add the parameter to the list of encoder parameters
encoderParams.Param[0]=encoderParam;//Save the bitmap using the JPEG encoder and the parameter list
bmp.Save(filename,codec,encoderParams);C# / DHTML / VG.net / MyXaml expert currently looking for work![^]
-
You can use the Quality encoder parameter, which works only with the JPEG encoder. Here's how to specify a quality level when saving an image:
//Get all the image encoders and find the one for the JPEG format
ImageCodecInfo[] codecs=ImageCodecInfo.GetImageEncoders();
ImageCodecInfo codec = null;
foreach(ImageCodecInfo c in codecs)
{
if(c.MimeType=="image/jpeg")
{
codec=c;
break;
}
}//Create a list of encoder parameters with space for a single entry
EncoderParameters encoderParams=new EncoderParams(1);
//Create a parameter to pass to the codec, with the category "Quality" and
//the desired quality value (where 100 is 100% quality)
EncoderParameter encoderParam=new EncoderParameter(Encoder.Quality, 90L);
//Add the parameter to the list of encoder parameters
encoderParams.Param[0]=encoderParam;//Save the bitmap using the JPEG encoder and the parameter list
bmp.Save(filename,codec,encoderParams);C# / DHTML / VG.net / MyXaml expert currently looking for work![^]
-
One simple way is to change the resolution using Bitmap.SetResolution() method to a less value.
Regards:rose:
-
Thanks for reply, but my files are in tif format.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - BabujiUnless the TIFF file uses JPEG compression (which is possible, but kind of pointless), the compression is lossless. That means that you can not change the quality of the compression as the compression does not make any quality compromises. Unless you specifically need the TIFF format, you could try the PNG format instead. It is also lossless, but compresses a lot better. If you want lossy compression, use the JPEG format.
--- Year happy = new Year(2007);