As a tired side note on the lack of optimization on the web and a commentary on how I really couldn't be arsed to go to sleep right now even though I really should, I optipng -o7'd the LWN.net corner image.
Turns out it could trivially be reduced by 21.37%, which comes to a whopping 2821 bytes! Just imagine the bandwidth savings achievable here. (The bulk of the reduction probably comes from the automatic removal of the completely superfluous alpha channel.)
Posted Oct 1, 2010 6:39 UTC (Fri) by psn (subscriber, #57668)
[Link]
Last-Modified: Fri, 04 Sep 2009 16:35:13 GMT
I suspect that any regular reader has the image cached.
Popularity of optimization
Posted Oct 4, 2010 15:42 UTC (Mon) by liljencrantz (subscriber, #28458)
[Link]
If LWN would decide to reduce the size of the icon, lots and lots of people would need to reload it, causing a large, temporary bump in site traffic. Is the long term gains large enough to offset the initial traffic hit?
Popularity of optimization
Posted Oct 4, 2010 15:49 UTC (Mon) by johill (subscriber, #25196)
[Link]
yet still accounts for 11.5GiB traffic to the site.
PNG saving and optimization
Posted Oct 4, 2010 19:29 UTC (Mon) by mjr (guest, #6979)
[Link]
Fist, my comment about the corner icon was, of course, mostly in jest - even if it does, in a very small part, illustrate that size optimality isn't something that everyone pays a lot attention to. (Not that it's a huge deal, really, just a fact of life.)
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.)
PNG saving and optimization
Posted Oct 4, 2010 19:39 UTC (Mon) by mjr (guest, #6979)
[Link]
Oops, misread output, correction: The header.png alpha channel is _not_ useless, and therefore not dropped by optipng either. The improved compression numbers are still correct, though.
PNG saving and optimization
Posted Oct 4, 2010 22:09 UTC (Mon) by johill (subscriber, #25196)
[Link]
Err, ok, I've optimised the image now with that tool (fwiw, back when it was created, I could only find pngcrush to use). But anyway, that wasn't really my point -- my point was that caching doesn't seem to play as big a role as one might be tempted to think.
PNG saving and optimization
Posted Oct 8, 2010 23:38 UTC (Fri) by man_ls (subscriber, #15091)
[Link]
Well, now you have the chance to try it out in practice: has the traffic surged because of the change in the icon? Has it slowed down after everyone cached the new version?
Advdef can squeeze files even more.
Posted Oct 6, 2010 7:30 UTC (Wed) by gmatht (guest, #58961)
[Link]
"... size optimality isn't something that everyone pays a lot attention to."
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.
Advdef can squeeze files even more.
Posted Oct 6, 2010 7:36 UTC (Wed) by johill (subscriber, #25196)
[Link]
Well, maybe our esteemed editor needs to write an article on this, because otherwise nobody's going to even find the tools.... :-)
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.
Advdef can squeeze files even more.
Posted Oct 6, 2010 8:54 UTC (Wed) by jbh (subscriber, #494)
[Link]
It's ok: it appears to be straight GPLv2, plus an exception allowing it to be linked with MAME.