In my application I need to resize and make the quality on PNG files poorer.
In full size the PNGs are 3100x4400px using 2,20MB disk space.
When running the fo
You can further reduce quality of PNG by using posterization:
https://github.com/pornel/mediancut-posterizer (Mac GUI)
This is a lossy operation that allows zlib to compress better.
Convert image to PNG8 using pngquant.
It reduces images to 256 colors, so quality depends on the type of image, but pngquant makes very good palettes, so you might be surprised how often it works.
Use Zopfli-png or AdvPNG to re-compress images better.
This is lossless and recommended for all images if you have CPU cycles to spare.
After using imagemagick
to resize, you can compress the image using pngquant.
On mac (with homebrew) brew install pngquant
then:
pngquant <filename.png>
This will create a new image filename-fs8.png
that is normally much smaller in size.
Help page says, that -quality
option used with PNG sets the compression level for zlib, where (roughly) 0 is the worst compression, 100 - is the best (default is 75). So try to set -quality
to 100 or even remove the option.
Another method is to specify PNG:compression-level=N
, PNG:compression-strategy=N
and PNG:compression-filter=N
to achieve even better results.
http://www.imagemagick.org/script/command-line-options.php#quality
I found that the best way was to use the
- density [value]
parameter.