chrissimpkins / Crunch
- вторник, 27 марта 2018 г. в 00:17:05
Shell
Insane(ly slow but wicked good) PNG image optimization (macOS)
Crunch is a macOS tool for lossy PNG image file optimization. It combines selective bit depth, color type, and color palette reduction with zopfli DEFLATE compression algorithm encoding using embedded versions of the pngquant and zopflipng PNG optimization tools. This leads to a significant file size gain at the expense of a relatively modest decrease in image quality (see example images below).
Mean percent original file size for the 21 files included in Cédric Louvrier's PNG Test Corpus files with Crunch v0.9.0 vs. other commonly used PNG optimization applications are:
Crunch | ImageOptim | OptiPNG | PNGOUT | PNGCrush | |
---|---|---|---|---|---|
Mean | 50.64% | 60.91% | 69.28% | 75.81% | 74.25% |
Full benchmarks with Crunch v0.9.0 are available here.
Want to kick the tires? Choose one of the methods below:
$ brew cask install crunch
Note that you must use brew cask install
and not brew install
!
Following your install you can upgrade to the latest version with:
$ brew cask uninstall crunch && brew cask install crunch
NOTE: Active bug with pngquant library dependencies using this install approach - See Issue Report #7 before use. Fix is in the works.
Download the dmg installer, click it, and drag the Crunch icon to your Applications directory.
Upgrade by following the same instructions and allowing the new version to replace the old version on your system.
The following examples demonstrate the benefits and disadvantages of the current iteration of this aggressive space saving lossy optimization strategy. In many cases, optimization with Crunch will lead to excellent space savings and an imperceptible decrease in image quality. In some cases, it does not (see the horizon line + clouds in the prairie photo below) . Experiment with the image types that you use and please submit an issue report with examples of any images where the image quality falls short of your expectations for production ready files.
All images above were obtained from Pixabay and are dedicated to the public domain under the CC0 Public Domain Dedication.
Drag and drop your PNG images onto the Crunch window:
Your optimized file is saved in the same directory as the original file with the modified path [original filename]-crunch.png
.
Please create a new issue report on the Github issue tracker.
Crunch is licensed under the MIT license.
pngquant is licensed under the Gnu General Public License, version 3. The pngquant source code is available here.
zopflipng is licensed under the Apache License, Version 2.0. The zopflipng source code is available here.
See the LICENSE.md document for details and additional licensing information for this project.