Code Monkey home page Code Monkey logo

crunch's Introduction

Crunch PNG file optimizationCrunch PNG file optimization Crunch PNG file optimization

About

Crunch is a macOS tool for 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 longer file optimization processing times and 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.

Initial impressions?

Crunch is doing a remarkably better job than ImageOptim for PNGs. The same file was reduced to 189k with ImageOptim and 95k with Crunch. Just wow. :)

@herrbischoff in #1

Install

Want to kick the tires? Choose one of the methods below:

1. Install with Hombrew Cask Package Manager

$ brew cask install crunch

Following your install you can upgrade to the latest version with:

$ brew cask uninstall crunch && brew cask install crunch

2. Install with dmg Installer

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.

Contents

Examples

The following examples demonstrate the benefits and disadvantages of the current iteration of this aggressive space saving lossy transformation 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.

Photography Examples

Cat Image

  • Original Size: 583,398 bytes
  • Optimized Size: 196,421 bytes
  • DSSIM similarity score: 0.001504
Original

cat example pre optimization

Optimized

cat example post optimization

Sun's Rays

  • Original Size: 138,272
  • Optimized Size: 64,947
  • DSSIM similarity score: 0.000913
Original

sun rays example pre optimization

Optimized

sun rays example pre optimization

Prairie Image

  • Original Size: 196,794 bytes
  • Optimized Size: 77,595 bytes
  • DSSIM similarity score: 0.002988
Original

prarie example pre optimization

Optimized

prarie example post optimization

Illustration Examples

Robot Image

  • Original Size: 197,193 bytes
  • Optimized Size: 67,632 bytes
  • DSSIM similarity score: 0.000163
Original

robot example pre optimization

Optimized

robot example post optimization

Color Circle Image

  • Original Size: 249,251 bytes
  • Optiimized Size: 67,225 bytes
  • DSSIM similarity score: 0.002503
Original

colors example pre optimization

Optimized

colors example post optimization

Flowers Image

  • Original Size: 440,126 bytes
  • Optimized Size: 197,045 bytes
  • DSSIM similarity score: 0.000481
Original

748

Optimized

748

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

Usage

Drag and drop your PNG images onto the Crunch window:

Crunch PNG image optimization usage

Your optimized file is saved in the same directory as the original file with the modified path [original filename]-crunch.png.

Issues

Please create a new issue report on the Github issue tracker.

Licenses

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 zopflipng source code is available here.

See the LICENSE.md document for details and additional licensing information for this project.

crunch's People

Contributors

chrissimpkins avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.