F
Franz
I want to ask about the png compression for Bitmap.Save
Here are the case :
Jpg (768 x 576 , 301KB) => Jpg (384 x 288, 22KB)
Jpg (768 x 576 , 301KB) => Png (384 x 288, 311KB)
Is the compression of png worst than that of jpg?
Here are the code :
Image image = Bitmap.FromFile(filePath);
int newWidth = (int)(percentage * image.Width);
int newHeight = (int)(percentage * image.Height);
Rectangle rectDest = new Rectangle(0, 0, newWidth, newHeight);
Bitmap bitmap = new Bitmap(rectDest.Width, rectDest.Height);
Graphics g = Graphics.FromImage(bitmap);
g.DrawImage(image, rectDest, 0, 0, image.Width, image.Height,
GraphicsUnit.Pixel);
image.Dispose();
bitmap.Save(filePath, format);
bitmap.Dispose();
Here are the case :
Jpg (768 x 576 , 301KB) => Jpg (384 x 288, 22KB)
Jpg (768 x 576 , 301KB) => Png (384 x 288, 311KB)
Is the compression of png worst than that of jpg?
Here are the code :
Image image = Bitmap.FromFile(filePath);
int newWidth = (int)(percentage * image.Width);
int newHeight = (int)(percentage * image.Height);
Rectangle rectDest = new Rectangle(0, 0, newWidth, newHeight);
Bitmap bitmap = new Bitmap(rectDest.Width, rectDest.Height);
Graphics g = Graphics.FromImage(bitmap);
g.DrawImage(image, rectDest, 0, 0, image.Width, image.Height,
GraphicsUnit.Pixel);
image.Dispose();
bitmap.Save(filePath, format);
bitmap.Dispose();