[webkit-dev] optimising png files in LayoutTests - an experiment

Adam Barth abarth at webkit.org
Tue Jan 24 23:11:10 PST 2012


On Tue, Jan 24, 2012 at 10:43 PM, Mike Lawther <mikelawther at chromium.org> wrote:
> Just thought I'd share the results of an experiment I did in optimising the
> png files in LayoutTests.
>
> I used a tool on Mac called ImageOptim (http://imageoptim.pornel.net/) which
> tries a set of different png lossless optimising tools (like pngcrush - I
> also downloaded and included PNGOUT). Note that this strips out some of the
> stuff we need, like the hash, so if doing this for real we'd have to watch
> out for that.
>
> My results were:
>
> Before:
> $ ls -laR LayoutTests/ | grep png$ | awk '{total = total + $5}END{print
> total}'
> 1220535840
>
> Test:
> $ find LayoutTests/ | grep png$ | xargs open -a ImageOptim.app
>
> After:
> $ ls -laR LayoutTests/ | grep png$ | awk '{total = total + $5}END{print
> total, 1220535840 - total}'
> 937198328 283337512
>
> So this has saved ~280MB (~23% of the original size).
>
> Based on this, it seems worthwhile to include a png optimiser somewhere in
> the patch upload/submit toolchain, and also (separately) to optimise the
> existing pngs.
>
> Thoughts?

Seems worth including in run-webkit-tests so that we generate
optimized PNGs.  That will cause us to slowly optimize our PNGs.
Note: we do use some of the metadata in the PNGs (e.g., the image hash
is stored in PNG metadata), which means we can't strip it call out.

Adam


More information about the webkit-dev mailing list