|
Hello,
Everywhere i read that the .png file format is a lossless file format.
What i am trying to do is downsize a .png file without the loss of color quality. Is this possible?
my code so far(but always losing color quality):
Dim im As Image = Image.FromFile("c:\temp\aaa\Copy.png")
Dim bm As Bitmap = New Bitmap(600, 600, im.PixelFormat)
bm.SetResolution(im.HorizontalResolution, im.VerticalResolution)
Dim g As Graphics = Graphics.FromImage(bm)
g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
g.DrawImage(im, 0, 0, 600, 600)
bm.Save("c:\temp\aaa\test.png", Imaging.ImageFormat.Png)
Thanks for any help;
|
|
|
|
|
Hold on a second....
"Lossless" means that saving an image compressed to reduce it's file size will not degrade the image whatsoever.
However, you are resizing the image - therefore - if you are resizing it smaller - you will "lose" pixels from the original.
As well - if you are increasing the size of an image - depending on the resizing algorithm used - you'll get approximations of the newly added pixels.
|
|
|
|