Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Optimize PNGs in themes and as part of build process #2827

wants to merge 2 commits into


None yet
3 participants

samatjain commented Oct 25, 2011

Since we're at RC2, I'm assuming images will not be changing much.

First commit losslessly re-compresses both themes' (default and valencia) images w/ optipng, advpng, and advdef, for a savings of 17%. Every byte counts!

I've also added new build targets, "images" and "imagesmin", which will copy and recompress images as part of jQM's build process.

More details on my research into PNG optimization at:


Fixes issue #2650.

samatjain added some commits Oct 25, 2011

Losslessly minimize themes’ PNGs
Minimized themes’ PNGs for a space savings of 17%.
Losslessly minimize PNGs as part of build process
Minimize PNGs w/ optipng, advpng, and advdef (these 3 tools compress
better than pngcrush). These 3 tools can be found in the Debian/Ubuntu
packages: optipng advancecomp

gseguin commented Oct 25, 2011


Thanks for the pull request. I like the idea but it adds a dependency on the png tools you're using. We should make it a soft dependency as in not fail if the tools aren't there, just warn.


samatjain commented Oct 25, 2011

@gseguin Thanks for the comments!

As is, it already soft fails—if the tools are not present, the unoptimized images will end up in the compiled directory/the zip archive without any other issue.

However, the warnings/errors printed aren't that pretty. I'll look into printing a more friendly warning.


eddiemonge commented Oct 25, 2011

If there truly is no difference in quality, then could you submit a pull request that just changes the images and doesnt include in the build process?


samatjain commented Oct 25, 2011

The recompression is lossless—no difference in quality. Most graphics packages don't do this amount of optimization because it'd take significantly more time to save PNGs.

Closing this pull request, new pull request is issue #2844.

@samatjain samatjain closed this Oct 25, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment