Last Comment Bug 653038 - Replacement image for sync-bg.png smaller optimized PNG.
: Replacement image for sync-bg.png smaller optimized PNG.
: footprint
Product: Firefox
Classification: Client Software
Component: Theme (show other bugs)
: 4.0 Branch
: All All
-- trivial with 1 vote (vote)
: Firefox 14
Assigned To: Charles Chan
: Dão Gottwald [:dao]
Depends on:
  Show dependency treegraph
Reported: 2011-04-26 19:47 PDT by Frédéric Kayser
Modified: 2012-03-19 03:28 PDT (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

sync-bg.png optimized (20.81 KB, image/png)
2011-04-26 19:49 PDT, Frédéric Kayser
no flags Details
Bug 653038 - Patch 1 (80.15 KB, patch)
2012-03-15 22:34 PDT, Charles Chan
dao+bmo: review+
Details | Diff | Splinter Review
sync-bg.png Huffmix+Pngout+Deflopt+Defluff optimized (20.56 KB, image/png)
2012-03-19 03:28 PDT, Frédéric Kayser
no flags Details

Description User image Frédéric Kayser 2011-04-26 19:47:48 PDT
User-Agent:       Mozilla/5.0 (Windows NT 6.0; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: 

File location in source:

Ends up here:

original:  26756 bytes
optimized: 21309 bytes
saved:      5447 bytes (more than 20%)

Reproducible: Always
Comment 1 User image Frédéric Kayser 2011-04-26 19:49:32 PDT
Created attachment 528516 [details]
sync-bg.png optimized
Comment 2 User image Charles Chan 2012-03-15 22:34:24 PDT
Created attachment 606473 [details] [diff] [review]
Bug 653038 - Patch 1

Update the .png with the optimized version.
Comment 3 User image Dão Gottwald [:dao] 2012-03-16 06:33:16 PDT
Comment on attachment 606473 [details] [diff] [review]
Bug 653038 - Patch 1

Comment 5 User image Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-03-17 17:04:31 PDT
Comment 6 User image 2012-03-18 15:19:36 PDT
Out of interest, which application did you use to optimise this .png file?
Comment 7 User image Frédéric Kayser 2012-03-19 03:22:50 PDT
(In reply to from comment #6)
> Out of interest, which application did you use to optimise this .png file?

It was probably pngout (ran in random mode dozens of time and trying many different block count).
Pngout is based on Ken Silverman's own deflate engine -kflate- most of the time, if not always, it produces smaller Deflate streams than Zlib and 7-Zip Deflate implementation but it's slow, very slow...

Since I have proposed this file   have written a small tool called Huffmix that is able to pick the smallest Deflate blocks out of different Pngout random runs.
Applied to sync-bg.png it gets even smaller... 21051 bytes.

To have a closer look at what's going on inside Deflate streams found in PNG or GZip files you can try Defdb.

PngWolf is also an interesting tool to improve multi-filter (f5) selection:
Pngwolf output can be recompressed using pngout -f6 (it will keep the filter selected for each scan-line).

State of the art PNG optimization has become a sort of black magic, since it takes 5 or 6 tools and a lot of time to get the best results:
- cryopng (to clear alpha, only for RGB+Alpha files)
- pngwolf (to get the best filters)
- pngout (best deflate engine)
- deflopt & defluff (to reduce Huffman tables)
- huffmix (to get the best out of pngout "random" mode)
(pngout -r, deflopt, defluff, huffmix can be run in a loop hundreds of time)
Comment 8 User image Frédéric Kayser 2012-03-19 03:28:04 PDT
Created attachment 607104 [details]
sync-bg.png Huffmix+Pngout+Deflopt+Defluff optimized

I don't know if it's worth reopening the bug, this new file is only 258 bytes smaller.

Note You need to log in before you can comment on or make changes to this bug.