I have a compressed PNG image compressed.png
. I can convert it to an uncompressed PNG decompressed.png
using GIMP (saving as PNG and setting compression level to 0). How can this be done on the command line (Linux)?
I recall doing this in the past using Imagemagick's convert
, but I forgot how. I tried some things that I thought should work based on the documentation:
convert compressed.png -compress None decompressed.png
convert compressed.png +compress decompressed.png
convert compressed.png -quality 0 decompressed.png
convert compressed.png -quality 00 decompressed.png
just wrote an ordinary compressed PNG.
Aside: why would you want an uncompressed PNG?
Some cases:
- You want to support efficient (binary) diffs of the image data, while still using other features of the PNG format (as opposed to storing raw image data or BMP).
- You want to compress several PNGs together in a tarball or 7z archive, but want to keep using PNG features. If the images are sufficiently similar this can give a better compression ratio than compressing individually.
- Useful as a baseline size for testing PNG optimizers.