Skip to content
Insane(ly slow but wicked good) PNG image optimization
Python HTML Shell Makefile
Branch: master
Clone or download
chrissimpkins [] updated install documentation
adds documentation for install account vs. execution account issue that was raised in #68
Latest commit ee00d14 Aug 14, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE updated bug report template with request for log file text May 31, 2018
bin/ Crunch macOS GUI v3.0.1 Jun 19, 2018
docs [] updated install documentation Aug 14, 2018
html added new animations to macOS GUI May 25, 2018
img modified macOS GUI idle animation to reduce CPU usage Jun 19, 2018
installer Crunch macOS GUI v3.0.1 installer added Jun 19, 2018
profile profile update Jun 19, 2018
service/Crunch Image(s).workflow/Contents support for parallel image file optimization with macOS right click m… May 9, 2018
src [] v3.0.1 Jun 19, 2018
testfiles new non-png test file May 19, 2018
ui/MainMenu.nib created custom nib file to fix window size and prevent resizing Mar 24, 2018
.gitignore update gitignore May 11, 2018 updated changelog Jun 19, 2018
Makefile [Makefile] add test-coverage and test-valid-png-output make targets May 16, 2018 [] updated new bug reporting URL Jun 7, 2018 added Python coverage testing shell script May 3, 2018 updated dmg builder script to automate SHA1 checksum files on installer Mar 26, 2018
tox.ini add tox.ini settings file for tox testing May 3, 2018

Crunch PNG file optimizationCrunch PNG file optimization Crunch PNG file optimization

GitHub release Build Status


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).

Historical benchmarks with the files included in Cédric Louvrier's PNG Test Corpus versus other commonly used PNG optimization software are available in

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

Install and usage documentation links for each of the Crunch applications are available below.

crunch Command Line Executable

The 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.

Crunch macOS GUI Application

The Crunch native macOS GUI application can be installed with Homebrew or the dmg installer that can be downloaded from the repository releases. Please see the Install documentation.

Drag and drop one or more images on the application window to process your PNG files. Please see the Usage documentation.

Crunch Image(s) macOS Right-Click Menu Service

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.



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. View the horizon line in the prairie photo below for a demonstration of an undesirable artifact that is introduced with image processing. 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.

Photography Examples

Cat Image

  • Original Size: 583,398 bytes
  • Optimized Size: 196,085 bytes
  • DSSIM similarity score: 0.001471
  • Percent original size: 33.61%

cat example pre optimization


cat example post optimization

Sun's Rays

  • Original Size: 138,272
  • Optimized Size: 66,593
  • DSSIM similarity score: 0.000948
  • Percent original size: 48.16%

sun rays example pre optimization


sun rays example pre optimization

Prairie Image

  • Original Size: 196,794 bytes
  • Optimized Size: 77,965 bytes
  • DSSIM similarity score: 0.002988
  • Percent original size: 39.62%

prarie example pre optimization


prarie example post optimization

Illustration Examples

Robot Image

  • Original Size: 197,193 bytes
  • Optimized Size: 67,596 bytes
  • DSSIM similarity score: 0.000162
  • Percent original size: 34.28%

robot example pre optimization


robot example post optimization

Color Circle Image

  • Original Size: 249,251 bytes
  • Optimized Size: 67,135 bytes
  • DSSIM similarity score: 0.002491
  • Percent original size: 26.93%

colors example pre optimization


colors example post optimization

Flowers Image

  • Original Size: 440,126 bytes
  • Optimized Size: 196,962 bytes
  • DSSIM similarity score: 0.000480
  • Percent original size: 44.75%




All images above were obtained from Pixabay and are dedicated to the public domain under the CC0 Public Domain Dedication.

Issue Reporting

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.

Embedded Software

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 upstream zopflipng source code is available here. The source for the modified zopflipng fork that is used in this project is available here.

See the 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:

The fantastic macOS GUI animations were designed by Gary Jacobs.

You can’t perform that action at this time.