chrissimpkins / crunch Goto Github PK
View Code? Open in Web Editor NEWInsane(ly slow but wicked good) PNG image optimization
License: Other
Insane(ly slow but wicked good) PNG image optimization
License: Other
If this just different default settings compared to ImageOptim?
PS: I used Platypus (progress bar) to do something like this in 2009 http://www.gingerbeardman.com/pngenie/
Right now I use Crunch for optimizing my pngs and a different tool (jpegoptim
-- https://github.com/tjko/jpegoptim) for optimizing my jpegs. It'd be nice if I could use crunch for both (ie only one command to remember instead of two).
have a Windows GUI Application?
Dyld Error Message:
Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
Referenced from: /Applications/Crunch.app/Contents/Resources/./pngquant
I would like to pull together more data on use cases where this is an appropriate tool and use cases where it is not. My experience is limited to the image types that I commonly make/use and I can say that after a couple of years' experience with the approach here it seems to be:
Useful, appropriate for:
Probably/maybe not appropriate for:
I would like to open this up for conversation with others out there so that we have a breadth of experience across different image styles. We can be objective about this by testing with the DSSIM tool across different types of image files. My gist is that as this value reaches and exceeds a value of 0.002 my eye begins to notice artifacts. It is possible that this could be turned into a parameter for the optimizations if it is real and able to be further generalized.
Goal will be to:
(1) document this for those who are interested in the tool
(2) further optimize the strategy used here by having much more objective data to base the optimization settings on. I think that we may be able to find a way to improve the compression ratios further, but likely only for certain types of image files.
If you have any thoughts, please weigh in and post examples of your images pre/post. If you have the ability to do so, please measure the DSSIM score for your pre/post optimization files with the open source dssim
tool that is available here: https://github.com/kornelski/dssim (and include the version of the dssim tool that you used!)
Thanks!
Hello, it's a great privilege to see Crunch open source 👏🏼, but currently only support PNG compression?
English is not my native language; please excuse typing errors.
🤔
No longer necessary following v2.0.0 release of Crunch
Read and test for 8 byte PNG signature in files, remove test for file extension type
Hi! I already installed the .dmg for mac (High Sierra), moved it into applications folder and then open it. After that, I try to drag files into the application but nothing happens...
Log files will be available for image optimization failures as of the v3.0.0 release. These logs should be included in all bug reports.
TODO:
PR submitted
= smaller file sizes when they are present in the image files
I'll just leave this here as "fyi": https://github.com/ianhuang-777/guetzli-cuda-opencl
Not sure if you have any use.
Crunch 1.0 (installer) doesn't work but brew 0.9.0 does
Mac OS X 10.10.5
dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib Referenced from: /Volumes/Crunch Installer/Crunch.app/Contents/Resources/./pngquant Reason: Incompatible library version: pngquant requires version 51.0.0 or later, but libpng16.16.dylib provides version 47.0.0 /Volumes/Crunch Installer/Crunch.app/Contents/Resources/script: line 10: 64882 Trace/BPT trap: 5 ./pngquant --quality=80-98 --skip-if-larger --force --ext -crunch.png "$imagepath" > /dev/null
I think you should say up front, quite clearly, that this is lossy compression. I wasn't aware of that until you mentioned in another issue.
The word lossy is only mentioned once in the README in the "Examples" section.
Given that repeat processing of the same file can degrade image quality it's quite important for people to know they should keep their master images around.
No longer necessary following v2.0.0 release of Crunch
Pull request: Homebrew/homebrew-cask#47418
Hi Crunch team,
Life saving tool!!!
Could you add a function that allow user to cover the original files directly with the crunched files generated? Thank you!
Greetings from Holland.
Bikman
Describe the bug
Upon opening crunch GUI, CPU usage sits 94-98%, even when no image has been optimised.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No cpu usage while idle
Adams-MBP:~ adamtester$ cat ~/.crunch/crunch.log
06-12-18 09:56:39 INFO [ 42.47% ] /Users/adamtester/Downloads/menu-logo-crunch.png (1984 bytes)
06-12-18 09:56:39 INFO Crunch execution ended.
Desktop (please complete the following information):
Additional context
Using beta macOS
reported by @herrbischoff in #1
I am tweaking the upstream google/zopfli source to achieve better zopflipng compression with 8-bit quantized PNG files. This custom zopflipng build will be included in the v3.0.0 release of Crunch. This build of zopflipng will be available for use through all of the Crunch tools. Work is taking place in chrissimpkins/zopfli. Testing is being performed on the true color PNG files in the Kodak Image Suite.
This issue replaces #34
After installing wthe DMG file and dragging the PNG, this is what I got:
dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib Referenced from: /Applications/Crunch.app/Contents/Resources/./pngquant Reason: image not found /Applications/Crunch.app/Contents/Resources/script: line 10: 6549 Abort trap: 6 ./pngquant --quality=80-98 --skip-if-larger --force --ext -crunch.png "$imagepath" > /dev/null
@chrissimpkins edits below -------
Associated closed issue reports to limit discussion to this thread:
TODO:
Try to install with the Homebrew cask install approach again. The installer script was updated with a couple of new dependencies and this should now be fixed
Please attempt your install with the v1.0.1 build. This should be the fix for this issue. Feedback needed to confirm and close this issue report.
See comments by @ScottRFrost in #28 (comment)
Need help from Windows developers on install scripting or a Win GUI installer. If that is you and you have the time/interest, let's discuss how we can make this happen.
Include:
Will support much faster optimization for multi image requests on multi processor machines
Need JS dev(s) who would be willing to pitch in to help with this.
Is Crunch based on pngquant?
Latest release is in the google/zopfli repository is tagged zopfli-1.0.1. Commits to master since include google/zopfli@e0e937e that suggest there may be improvements in compression of smaller files.
@lvandeve Lode, is the tip of google/zopfli master stable for production use? The latest tagged release was zopfli-1.0.1 (google/zopfli@89cf773) back in 2015. This is what I am using here to compile the zopflipng executable but more recent commit messages suggest there may have been compression improvements for smaller pre-files since that time. I don't see a test suite to confirm on my own.
TODO:
Homebrew cask now supports the following command which will automatically update the Crunch macOS GUI installed through Homebrew cask to new releases since you last installed/updated:
$ brew cask upgrade
Thanks to @adidalal for this information in #49 (comment). Will update documentation on the README and in the macOS GUI About text.
TODO:
homebrew cask upgrade
approach to upgradeshomebrew cask upgrade
approach to upgradesRather than compiling from source it'd be nice if Crunch could just make use of brew-installed versions of pngquant & zopflipng.
Definitive solution to #7 and will be released as a new version of Crunch.
Instructions for static linking of the pngquant library dependencies libpng
and little-cms2
are available in this document:
This issue only affects the macOS GUI and macOS right-click menu service tools. It does not affect the command line executable crunch
.
#30 was not fully addressed as intended in the v2.0.2 release. As of v2.0.2, images on paths that include spaces within the path at more than one directory level will not be optimized. Fix in the works and will be available as part of the v2.1.0 release #46
Workaround: remove spaces in the absolute path to your image file(s).
cc:@masey9
Improved speed on large image files
TODO:
For each of the demo pictures in README.md
, it might be useful to show the percentage of memory saved by using Crunch's optimizations alongside the Original/Optimized Size and DSSIM similarity score.
Memory saved = (Original_Size - Optimized_Size) / Original_Size
Normally I want just to compress the original exported assets so would be nice to have an "overwrite original" option
Thanks for the great work 👍
First, great work on the app!
It would be great to see an auto-update feature added to the GUI. If that's more work than you care to take on, a simple notification that an update is available when the app is launched would be sufficient.
Thanks!
@chrissimpkins edits below:
Current approach for auto-updates of macOS GUI application is through Homebrew cask with the following command after a previous install:
$ brew cask upgrade
This checks for a new version c/w your currently installed version and automatically upgrades if a more current release is available. The Homebrew installation approach remains the recommended approach for the macOS GUI tool in this project.
See #49 (comment) for an approach to upgrades if you do not have Homebrew installed on your macOS system.
crunch2.com
now https://getcrunch.co
"If you like writing Less instead of CSS, you shouldn’t have to run scripts in your terminal like this is 1992, or install apps that do nothing except babysit your style files.
Crunch lets you write Less, Sass, CoffeeScript, Markdown*, and then automatically saves CSS, JavaScript, and HTML after you’ve made changes. Want to write just plain CSS? XML? Haskell? MUSHCode? Crunch lets you do that too.
Crunch 2 is an editor that lets you do what you want. Because Crunch loves you."
I just testes Crunch with a file named MILITARY 2016-04-10 15.47.11.png
(a screenshot from the console game Military Madness). Stage 1 worked somehow, Stage 2 did not at all:
• • • Crunching /Users/[REDACTED]/MILITARY 2016-04-10 15.47.11.png...
Original size (kB): 471.940
==> Running stage 1 optimizations...
stat: /Users/[REDACTED]/MILITARY 2016-04-10 15-crunch.png: stat: No such file or directory
(standard_in) 1: parse error
Current size (kB): 0.000
==> Running stage 2 optimizations...
==> Hold tight. This could take awhile.
==> Click Cancel at any time to save at the above size.
[ERROR] Unable to access the file for optimizations. Please report this issue.
stat: /Users/[REDACTED]/MILITARY 2016-04-10 15-crunch.png: stat: No such file or directory
---
Optimized filepath: /Users/[REDACTED]/MILITARY 2016-04-10 15-crunch.png
(standard_in) 1: parse error
Final size (kB): 0.000
(standard_in) 1: parse error
Percent original: 0.00%
(standard_in) 1: parse error
Space saved (kB): 0.000
---
PR submitted: Homebrew/homebrew-cask#48667
I noticed this evening that Crunch will only execute successfully when I drag in PNG files from my Mac desktop into the GUI. If I drag them in from a folder on the desktop (eg. desktop/folder/image.png) then crunching fails to execute.
@chrissimpkins edits below:
Fix available for testing in #38 for anyone who is affected by this issue. Please weigh in on whether this fixes it for you in this thread. Thanks.
Here are some updated animations for the GUI version of "Drag and Drop"
There are 5 states outlined as follows:
01-Load-Up.gif
This should play once and then switch to "Waiting"
02-Waiting.gif
This will loop and wait until the user places file(s) onto the GUI window
03-Crunching.gif
This will loop while the magic is happening
04-Error.gif
This will play once when something went Wrong (error)
04-Success.gif
This will play once when the compression is complete and state in view for 1-2 secs then reset back to "Waiting GIF".
Dimensions of animations are 600x300 - these would look best filling the entire container it sits in.
Open to suggestions on wording and visuals displayed here.
@chrissimpkins edits below:
TODO:
img
directoryTest builds of the pngquant and zopflipng dependencies just began failing today with the following error during the attempt to build pngquant:
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
src/install-dependencies.sh: 46: cd: can't cd to libpng-1.6.34
make: *** [build-dependencies] Error 1
This occurs when you build these dependencies with make build-dependencies
in order to use the command line executable.
This is happening because the Sourceforge file server is down and the libpng source code download is not accessible. libpng is a requirement for pngquant builds. You can check on availability with the following download link: https://download.sourceforge.net/libpng/libpng-1.6.34.tar.xz
When the source pulled through that link is available, this error should disappear.
This error does not apply to the macOS GUI or macOS right click menu service.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.