Bug 20211 - compress PNG images
Summary: compress PNG images
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords: DoNotImportToRadar
Depends on:
Blocks:
 
Reported: 2008-07-29 11:42 PDT by Dimitri
Modified: 2023-11-22 10:53 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitri 2008-07-29 11:42:55 PDT
I suggest compressing the PNG images in WebKit using a tool such as "optipng" and possibly "pngout":
	http://optipng.sourceforge.net
	http://www.jonof.id.au/index.php?p=kenutils

Two reasons for compressing images:
1) Compressed images result in smaller source packages and binaries.
2) Compressed images load faster.

I see two main options for compressing images:
1) Compress using "optipng -nc -o7" which doesn't change color type (for example "8-bit/color RGB" won't be changed into "8-bit colormap"). It is probably important for artists not to change the color type...
2) Compress using plain "optipng -o7" and "pngout". This achieves much better compression, but often changes the color type.

Here is what you can expect from PNG image compression, from the point of view of source package size:
	$ du -sb WebKit-r35417.orig
	44918896        WebKit-r35417.orig
	$ du -sb WebKit-r35417.optipng-nc
	44908175        WebKit-r35417.optipng-nc
	$ du -sb WebKit-r35417.optipng+pngout
	44625618        WebKit-r35417.optipng+pngout
	$ 
With "optipng -nc":
	10721 bytes less, 0.02% of the source package
With "optipng" and "pngout":
	293278 bytes less, 0.65% of the source package

I know: that's not much. Chances are speed improvements in loading images might be marginal as well. Still... What about it?
Comment 1 Pierre-Luc Beaudoin 2008-07-29 12:12:57 PDT
We could also separate website/blog SVN, source SVN and possibly test SVN (although committing the test case at the same time as the fix makes sens).
Comment 2 Ahmad Saleem 2023-11-22 10:53:29 PST
@Sam - I know you recently did compress a lot of assets, is this still needed bug or we can close this?