Crunch is a 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 the pngquant and zopflipng PNG optimization tools. This approach leads to a significant file size gain relative to lossless approaches at the expense of a relatively modest decrease in image quality (see example images below).
Crunch PNG image optimization is available through the following applications in this repository:
crunch- a *nix command line executable that can be used on macOS, Linux, and Windows POSIX application deployment environments such as Cygwin
- Crunch GUI - a native macOS drag and drop GUI tool
- Crunch Image(s) service - a macOS right-click menu service for PNG images selected in the Finder
Install and usage documentation links for each of the Crunch applications are available below.
crunch command line executable can be installed with
make or manually. Please see the Install documentation.
Enter paths to your PNG image files as arguments to the
crunch executable. Please see the Usage documentation.
Drag and drop one or more images on the application window to process your PNG files. Please see the Usage documentation.
The macOS right-click menu service "Crunch Image(s)" can be installed with
make or manually by drag and drop in the macOS Finder. Please see the Install documentation.
Select one or more PNG images in the Finder, right-click, and select the
Services > Crunch Image(s) menu item to process your files. Please see the Usage documentation.
- Issue Reporting
The following examples demonstrate the benefits and disadvantages of the current iteration of Crunch's aggressive space saving optimization strategy. In many cases, the PNG optimization minimizes file size with an imperceptible decrease in image quality. In some cases, degradation of image quality is visible. For example, view the horizon line + clouds in the prairie photo below for a demonstration of the introduction of undesirable image artifacts in the image. Experiment with the image types that you use and please submit a report with examples of any images where the image quality falls short of expectations for production-ready files.
- Original Size: 583,398 bytes
- Optimized Size: 195,430 bytes
- DSSIM similarity score: 0.001504
- Original Size: 138,272
- Optimized Size: 64,982
- DSSIM similarity score: 0.000913
- Original Size: 196,794 bytes
- Optimized Size: 77,968 bytes
- DSSIM similarity score: 0.002988
- Original Size: 197,193 bytes
- Optimized Size: 67,773 bytes
- DSSIM similarity score: 0.000163
- Original Size: 249,251 bytes
- Optiimized Size: 67,326 bytes
- DSSIM similarity score: 0.002503
- Original Size: 440,126 bytes
- Optimized Size: 196,979 bytes
- DSSIM similarity score: 0.000481
Have you identified a problem? Please create a new issue report on the Github issue tracker so that we can address it.
Crunch is licensed under the MIT license.
See the LICENSE.md document for details and additional licensing information for this project.
Contributions to the project are warmly welcomed. Please suggest enhancements as new issue reports on this repository. Source contributors should fork the git repository and submit changes as a Github pull request.
Crunch is a simple tool that makes excellent, free, open source software built by others more accessible. The hard work on the optimization engines that run Crunch has been performed by: