BMP -> PNG -> BMP adds 50% to file size?!
Posted: 2011-10-27T19:28:58-07:00
I'm trying to propose storing test result BMP images as PNG, and I've written a Windows CMD file to mass convert tens of GB of BMPs using ImageMagick 6.7.3-2 2011-10-21 Q8. It works great, but I wanted to make sure I can re-create an identical BMP file if it's needed for further processing later. I can convert back to BMP, but an 8MB BMP converts to a 4MB PNG, which converts with ImageMagick to 12MB. Opening the PNG with the GIMP and saving as BMP brings it back to the original BMP's file size. All images compare to 0 different pixels with compare using:
compare -metric AE -fuzz 0
and the only difference between the outputs of identify -verbose on the different size BMPs is the resolution, is tagged in the larger BMP, file size/time stamps and the identify performance metrics.
I've searched around for settings to try, after making sure I was runing a Q8 version, such as adding +matte or -colors 256, or even going through ppm and a second convert to throw away any gamma info which might have been in the PNG. Oddly enough, -colors 256 gives the 12MB file, but -colors 255 gives a 4MB BMP file - half the original's 8MB. identify -verbose states that the 4MB bmp has a depth of 4/8-bit, Gray: 8-bit, but Colormap: 16, and only 16 colors are listed in the map.
The 12MB files are probably fine to use, but I'd like to understand what's going on, and be able to reproduce the original file size if possible, since this whole project was to save server disk space. Anyone?
compare -metric AE -fuzz 0
and the only difference between the outputs of identify -verbose on the different size BMPs is the resolution, is tagged in the larger BMP, file size/time stamps and the identify performance metrics.
I've searched around for settings to try, after making sure I was runing a Q8 version, such as adding +matte or -colors 256, or even going through ppm and a second convert to throw away any gamma info which might have been in the PNG. Oddly enough, -colors 256 gives the 12MB file, but -colors 255 gives a 4MB BMP file - half the original's 8MB. identify -verbose states that the 4MB bmp has a depth of 4/8-bit, Gray: 8-bit, but Colormap: 16, and only 16 colors are listed in the map.
The 12MB files are probably fine to use, but I'd like to understand what's going on, and be able to reproduce the original file size if possible, since this whole project was to save server disk space. Anyone?