Skip to content

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

Closed
wants to merge 2 commits into from

3 participants

@samatjain

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:

http://wiki.samat.org/CheatSheet/ImageOptimization

Fixes issue #2650.

samatjain added some commits Oct 24, 2011
@samatjain samatjain Losslessly minimize themes’ PNGs
Minimized themes’ PNGs for a space savings of 17%.
f7c59b8
@samatjain samatjain 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
5cb3d0c
@gseguin
jQuery Foundation member
gseguin commented Oct 25, 2011

@samatjain

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

@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

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

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
Something went wrong with that request. Please try again.