Scaling a PNG image smaller produces a larger file size
Posted: 2007-11-01T11:24:38-07:00
I am using Magick++ as my programming interface, with ImageMagick 6.3.6-4. I scale a PNG image from its current size of 608x308, which has a total file size of 271,465, to a size of 368x169. The resultant PNG image now has a file size of 373,702 !!!
How can this be ?
I can bring both images into PaintShop Pro and the images are both recognized correctly as PNG images and the width and height of the images are correct.
If I open the original image in PaintShop Pro and use its resize feature to scale it down accordingly, the resultant file size is 87,435, which is close to what I expect.
If I try the same sort of scaling from the ImageMagick command line using the convert command, the same increase in file size occurs, so this is not just an issue with my programming interface.
I thought that perhaps some sort of compression algorithm was not occuring but if I try to compress the file from the ImageMagick command line using convert no change in file size occurs.
Hopefully someone will have a clue as to what is happening, but scaling of a PNG image appears somehow incorrect in ImageMagick if scaling the width and height downward produces a much larger file size.
How can this be ?
I can bring both images into PaintShop Pro and the images are both recognized correctly as PNG images and the width and height of the images are correct.
If I open the original image in PaintShop Pro and use its resize feature to scale it down accordingly, the resultant file size is 87,435, which is close to what I expect.
If I try the same sort of scaling from the ImageMagick command line using the convert command, the same increase in file size occurs, so this is not just an issue with my programming interface.
I thought that perhaps some sort of compression algorithm was not occuring but if I try to compress the file from the ImageMagick command line using convert no change in file size occurs.
Hopefully someone will have a clue as to what is happening, but scaling of a PNG image appears somehow incorrect in ImageMagick if scaling the width and height downward produces a much larger file size.