Closed Bug 1052837 Opened 11 years ago Closed 11 years ago

pngcrush and pngquant all the images in our tree

Categories

(Firefox for Android Graveyard :: Theme and Visual Design, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: wesj, Assigned: wesj)

References

Details

Attachments

(1 file)

We should be doing this when we check things in, but a quick scan shows we haven't been. Running both on just mobile/android saves about 200K on the APK size. Running them on toolkit gave me another 100K, but getting that patch checked in is probably more work. I'm going to do one more run with the --speed 1 flag and then I'll upload a patch.
Attached patch PatchSplinter Review
I have a feeling there's some reason these aren't done and this is going to be r-, but until then, here's a patch! For myself in the future, a little bash script to do this: #!/bin/sh #modified from http://davidwalsh.name/pngcrush-directory for png in `find $1 -name "*.png"`; do echo "crushing $png" cp "$png" temp.png pngquant --speed 1 temp.png pngcrush -reduce -brute temp-fs8.png "$png" # mv temp.png "$png".old rm temp.png rm temp-fs8.png done;
Attachment #8471886 - Flags: review?(rnewman)
The reason we haven't done this for every image is that quanting causes banding; when I did a full pass, I only accepted quanted images with fewer than 256 colors, or where there was no visual difference under 8x magnification. See Bug 959833 Comment 25. (This was a pretty laborious process.) Additionally, I *think* the Android build process crushes PNGs automatically. I would be interested to see the size difference without quanting every image -- manually crushing might not be worthwhile. Probably most of the size saving from this patch comes from the Firefox logo itself (in its various sizes), which responds very poorly to quanting, and which I omitted from Bug 959833. So: please let's make sure that these changes don't regress anything visually (i.e., only accept lossless quanting), and then verify that we're saving APK size by crushing versus just quanting new images since Bug 959833.
Depends on: 959833
Assignee: nobody → wjohnston
Blocks: fatfennec
Status: NEW → ASSIGNED
Component: General → Theme and Visual Design
OS: Linux → Android
Hardware: x86_64 → All
Comment on attachment 8471886 [details] [diff] [review] Patch f+ on principle; see last comment.
Attachment #8471886 - Flags: review?(rnewman) → feedback+
ckitching found some other space savers. I'm not chasing this anymore, and based on rnewman's comment, I don't think anyone should.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: