Not logged in
Log in now
Create an account
Subscribe to LWN
Deadline scheduling: coming soon?
LWN.net Weekly Edition for November 27, 2013
ACPI for ARM?
LWN.net Weekly Edition for November 21, 2013
GNU virtual private Ethernet
Last-Modified: Mon, 29 Jan 2007 11:04:48 GMT
yet still accounts for 11.5GiB traffic to the site.
PNG saving and optimization
Posted Oct 4, 2010 19:29 UTC (Mon) by mjr (subscriber, #6979)
Second, amusingly the header.png you link also has a useless alpha channel, and optipng -o7 can shave off a whole 17131 bytes (16.22%) off of it. There are probably a lot of such pictures out there - I think gimp produces pngs with empty alpha channels by default when the source image has it, even if the exported (possibly flattened) bitmap doesn't require it. I wonder if that should be a bug.
Anyway, optipng is a nice tool to run at least for images that'll be served lots and lots of times. Even if you don't use the slow, -o7 "obsessive-compulsive" mode, it can often improve on the compression settings a bit. More importantly, it will remove that spurious alpha channel and also do other color type/bit depth/palette reductions where appropriate.
(Being myself a tad OCD, checked that the header.png "only" reduced by 16976 bytes or 16.07% using optipng's fast 8-trial default settings. For comparison, -o7 runs through 240 trials of different setting combinations.)
Posted Oct 4, 2010 19:39 UTC (Mon) by mjr (subscriber, #6979)
Posted Oct 4, 2010 22:09 UTC (Mon) by johill (subscriber, #25196)
Posted Oct 8, 2010 23:38 UTC (Fri) by man_ls (guest, #15091)
Advdef can squeeze files even more.
Posted Oct 6, 2010 7:30 UTC (Wed) by gmatht (guest, #58961)
Quite right. If they did, they would run "advdef -z -4" after optipng ;)
I can shave another 11k off header.png and 1k off lcorner.png using advdef. The KDE project uses a script "optimizegraphics" to run these two optimizations on their graphics files.
Posted Oct 6, 2010 7:36 UTC (Wed) by johill (subscriber, #25196)
Note also that you may not always even be allowed to use advdef, because it appears to link to something called MAME, which states "Redistributions may not be sold, nor may they be used in a commercial product or activity." Thus I'd rather stay away from it.
Posted Oct 6, 2010 8:54 UTC (Wed) by jbh (subscriber, #494)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds