Crunch
p/crunch-4
Insanely good PNG image optimization
Chris Simpkins
Crunch 2.0 β€” Insane PNG image optimization
Featured
18
β€’

Crunch is a free, open source application for PNG image optimization.

The v2.0 release includes:

- New command line executable support for use on any *nix machine

- Parallel image processing support

Thanks to the Product Hunters who made recommendations in the v1.0 announcement threads that led to these improvements!

MIT License

Replies
Antoine Plu
Congrats for the v2 πŸŽ‰ What are the main differences with tools like ImageOptim or Kraken ?
Chris Simpkins
@antoineplu Thanks Antoine! Re: ImageOptim, here is my reply to that question on the repository: https://github.com/chrissimpkins... I am afraid I have no experience with Kraken. Do you have details on the application? Happy to respond once I know how it works.
Chris Simpkins
@antoineplu Also see my response to @jacqvon in the first post of this discussion thread. It contains a fairly lengthy description of the available applications and approach so that you can determine whether it is worth investing your time in a test drive.
Damjanski
<3 <3 <3
Saijo George
Any plans for a Web Interface or Windows Application?
Chris Simpkins
@saijogeorge Web application would require: - free server (I don't intend to pay to support this / create paid plans for it) - front end developer to help implement (the backend work is largely in place and I can contribute this) Feel free to open an issue report if you have an interest in this and are aware of any server services that support open source projects at no cost at the data transfer/processing levels that this would require. I am not aware of any. If someone else wants to support it financially, I would be more than willing to help implement it. The licenses across the project tooling support anyone taking the source in the repository and running with this idea on their own. It's a great idea. Unfortunately, it begins to become "un-free" (of cost) for the developer when you dive into web application distribution to users. Windows GUI application would require: - developer with native Win GUI application development experience There is an open issue report for the Win GUI and I'd encourage anyone with the experience and an interest to weigh in. I am definitely in support of making it happen. I considered an Electron application but it seemed silly to take a 2MB native application (on macOS) and turn it into a 100MB+ application. It just seemed to be too much for this simple application. There are other cross-platform GUI frameworks / libraries out there, but large application size will be the common theme across all of them. FWIW, we are also discussing how to implement a command line executable on Win without the need for a POSIX application environment in an issue report that was just opened today. Have a look at the repo issues and feel free to weigh in with your thoughts.
Chris Simpkins
No problem Saijo. Thanks for your interest in the tool.
Stas Kulesh

I've been using imageoptim for a while. Crunch takes it to the next level.

Pros:

It's a great hybrid tool for squeezing pixels out.

Cons:

It may be slow at times.

Jacqueline von Tesmar
Hey @csimpkins, How does this app stand out from other similar apps?
Chris Simpkins
@jacqvon Hi Jacqueline. Thanks for the question! I had a limited number of characters in the description to lay out the full details of the tools in the Crunch project. Here is a much more detailed overview. There are numerous applications that optimize image files. I don't claim to know all of the available tools out there to provide you with a head-to-head comparison, but my understanding is that most share a similar set of embedded tools that perform these optimizations across the various supported image types. When you talk benefits of image optimization tools it boils down to the following in order of priority for me: (1) the quality of the optimized image; (2) how small the optimized file size is; (3) how long it takes to process images; (4) how simple it is to use the tool; (5) where you can use the tool (i.e., what platforms and the approaches for use on those platforms). Crunch is a targeted application that only works with PNG images and uses a more aggressive, space-saving lossy optimization strategy compared with the many lossless applications that are available out there for PNG images. I am attempting to achieve a balance between a modest decrease in image quality and a significant decrease in file size. The quality issue lies in the eye of the beholder and users will need to explore the tool with their typical body of PNG images to see if they can perceive the difference. I have used the tool in nearly all of my production images over the last two years, and it works very well for my image types. It will not be the tool for users who need to display high definition images with large numbers of colors + color gradients. Here are my thoughts on how it performs across the spectrum of the above priorities: Image quality: In most cases, the decrease in quality is imperceptible. I posted several photographs and illustrations on the repository README that demonstrate where it works well and where it does not. For those who are more quantitatively driven, I also display a measure of the dissimilarity between pre/post images known as the DSSIM score (lower score better, 0 = identical). Interested users can replicate this testing on their images across different optimization tools. The DSSIM tool is a free, open source project. Image size: Users will see much smaller image sizes compared with lossless tools. This will be the case when compared to some of the commonly used products for lossy PNG image optimization out there as well. For web developers, mobile application developers, and others for whom image size matters, this will be a significant benefit. Execution time: There is no dispute that the processing with the tooling that I am implementing here is slow. It is just the nature of the algorithms that are being used to optimize the files and is the tradeoff for smaller file sizes. I've done a great deal of experimentation with the approach to achieve the best size/speed balance that I can. This v2 release introduces parallel image processing for users who are optimizing multiple images on multi-processor machines. This is an embarrassingly parallel problem, and execution takes place in true parallel fashion, so there is a tremendous speedup in v2.0 relative to previous versions for multi-image processing on multi-processor machines. This was implemented in the macOS GUI application, the macOS right-click menu service, and the new command line executable. Simplicity: There are three Crunch tools that were designed to be as simple as possible. The macOS GUI application (Crunch) is a drag and drop window without any other bells and whistles. Click to open, then drag/drop one or more PNG files on it. The macOS right-click menu service allows you to select one or more PNG files in the macOS Finder window and select Services > Crunch Image(s) to optimize the images. The new command line executable `crunch` takes image arguments and processes them with the same approach and same version of dependencies that are used in the GUI tools. You execute it by adding a list of image file arguments to the executable without the need for options to declare out file paths, compression levels, etc. It is an integrated system of applications with extremely simple designs that should produce the same optimized images whether you prefer to work through an application window, a right-click menu, or on the command line / through shell scripting. Use scenarios: The GUI applications are both macOS-specific. The command line executable works on *nix platforms, including macOS, Linux, and Windows with POSIX application environments like Cygwin. As of this v2.0 release, there is now a cross-platform command line executable tool that makes it possible to use the Crunch approach on non-macOS systems. This addresses a request from Linux users out there and opens up the possibility to automate the image optimization through scripting. This will be a benefit for many developers/designers. The project and its embedded tooling are licensed under OSI-approved free, open source licenses and can be used in accordance with those licenses. While not mentioned in my list of priorities, cost is clearly a factor. Crunch is provided at no cost to users. All of the tools are available for free. There are detailed installation instructions on the repository README page. Enjoy!
Graeme
any api plans like tinypng? https://tinypng.com/developers
Chris Simpkins
@graeme_fulton Do you have a server that we can use ;) I do not intend to implement any paid plans in order to support server use that would be necessary to create this but it is a great idea. The new command line executable that was just released in v2.0 will permit those who want to implement such an approach for their own personal use or for distribution to others to do so. The `make` install tooling makes it very straightforward to install the dependencies and executable on Linux servers. If this is a project that you or someone else out there tackles, I would love to release documentation about how you do it so that we can make this information available for other users.
Vlad Korobov
Sketch plugin PLEEEEEEEEAAAAAASE
Chris Simpkins
@vladkorobov Do you have any background in developing Sketch plugins? I am definitely open to this but haven't created a plugin in the past so it would take a bit of investigation to see if it is possible. This is worth an issue report on the repository if you would be willing to open one in order to get the conversation started.
Vlad Korobov
@csimpkins I am sure this is possible because other plugins act in the way. Basically what should be done is Hotkey to export selected artboard or whatever in PNG (open save dialog or put in a particular folder which could be defined in settings)
Chris Simpkins
@vladkorobov will look into it. Thanks for the suggestion Vlad.
Chris Simpkins
@vladkorobov I added a new issue report on the repository for this request. Let's see if we can attract JS developers to make this happen. I reviewed the docs and agree it will be possible. Need someone with the JS chops to write the scripts.