Compressing PNG with given quality
Hello I am saving JPG file with the following SUB.
Sub SaveJPG(ByVal Image As Image, ByVal FileName As String, _
ByVal QualityLevel_0_100 As Byte, _
ByVal ColorDepthLevel As Byte)
Dim ImageCodecInfoJPG As ImageCodecInfo =
GetEncoderInfo("image/jpeg")
Dim EP As New EncoderParameters(2)
EP.Param(0) = New EncoderParameter(Encoder.Quality,
QualityLevel_0_100)
EP.Param(1) = New EncoderParameter(Encoder.ColorDepth,
ColorDepthLevel)
Image.Save(FileName, ImageCodecInfoJPG, EP)
End Sub
1. How can I do the same with PNG (I need to specify the compression
level if possible because
I always get PNG too big)
2. Given a Bitmap, what the best way to set ColorDepthLevel ? What's
the procedure to determine the best value for a given bitmap?
-P
Date:Thu, 23 Aug 2007 03:53:18 -0700
Author:
|