Shrinking unoptimized PNGs

NEW
Unassigned

Status

()

Firefox for Android
General
2 years ago
2 years ago

People

(Reporter: sebastian, Unassigned, Mentored)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
I wrote a little script to traverse the tree, search PNGs, run pngcrush on it and compare the sizes:
https://github.com/pocmo/Find-Unoptimized-PNGs

The overall result is that there's not much to optimize left (at least with pngcrush): -34962 bytes.

In mobile/android (without test):
* 489 file(s) are optimized, 68 file(s) are in need of optimization
* 557 files with 108719 bytes, 73757 bytes optmized (-34962 bytes)

In case someone wants to go through those files, optimize them, compare them and create a patch:

> mobile/android/app/assets/parental_controls_theme.png
> -25% / -756 bytes   original=2915 bytes, optimized=2159 bytes
> 
> mobile/android/base/resources/drawable-hdpi/alert_camera.png
> -0% / -1 bytes   original=206 bytes, optimized=205 bytes
> 
> mobile/android/base/resources/drawable-hdpi/alert_mic_camera.png
> -2% / -5 bytes   original=247 bytes, optimized=242 bytes
> 
> mobile/android/base/resources/drawable-hdpi/blank.png
> -1% / -1 bytes   original=82 bytes, optimized=81 bytes
> 
> mobile/android/base/resources/drawable-hdpi/color_picker_row_bg.9.png
> -1% / -2 bytes   original=121 bytes, optimized=119 bytes
> 
> mobile/android/base/resources/drawable-hdpi/folder_closed.png
> -43% / -146 bytes   original=339 bytes, optimized=193 bytes
> 
> mobile/android/base/resources/drawable-hdpi/handle_end.png
> -23% / -136 bytes   original=570 bytes, optimized=434 bytes
> 
> mobile/android/base/resources/drawable-hdpi/handle_middle.png
> -15% / -105 bytes   original=692 bytes, optimized=587 bytes
> 
> mobile/android/base/resources/drawable-hdpi/handle_start.png
> -22% / -132 bytes   original=581 bytes, optimized=449 bytes
> 
> mobile/android/base/resources/drawable-hdpi/reading_list_migration.png
> -33% / -967 bytes   original=2906 bytes, optimized=1939 bytes
> 
> mobile/android/base/resources/drawable-hdpi/status_icon_readercache.png
> -32% / -193 bytes   original=598 bytes, optimized=405 bytes
> 
> mobile/android/base/resources/drawable-hdpi/suggestedsites_amazon.png
> -30% / -1311 bytes   original=4253 bytes, optimized=2942 bytes
> 
> mobile/android/base/resources/drawable-hdpi/suggestedsites_facebook.png
> -38% / -231 bytes   original=603 bytes, optimized=372 bytes
> 
> mobile/android/base/resources/drawable-hdpi/suggestedsites_twitter.png
> -45% / -589 bytes   original=1304 bytes, optimized=715 bytes
> 
> mobile/android/base/resources/drawable-hdpi/suggestedsites_wikipedia.png
> -38% / -777 bytes   original=2037 bytes, optimized=1260 bytes
> 
> mobile/android/base/resources/drawable-hdpi/suggestedsites_youtube.png
> -33% / -942 bytes   original=2773 bytes, optimized=1831 bytes
> 
> mobile/android/base/resources/drawable-hdpi-v11/star_blue.png
> -3% / -30 bytes   original=754 bytes, optimized=724 bytes
> 
> mobile/android/base/resources/drawable-large-hdpi-v11/ic_menu_reload.png
> -1% / -8 bytes   original=779 bytes, optimized=771 bytes
> 
> mobile/android/base/resources/drawable-large-hdpi-v11/toolbar_favicon_default.png
> -1% / -2 bytes   original=134 bytes, optimized=132 bytes
> 
> mobile/android/base/resources/drawable-large-hdpi-v11/url_bar_entry_default.9.png
> -0% / -2 bytes   original=261 bytes, optimized=259 bytes
> 
> mobile/android/base/resources/drawable-large-xhdpi-v11/toolbar_favicon_default.png
> -0% / -1 bytes   original=153 bytes, optimized=152 bytes
> 
> mobile/android/base/resources/drawable-large-xxhdpi-v11/ic_menu_reload.png
> -0% / -1 bytes   original=1324 bytes, optimized=1323 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/device_desktop.png
> -1% / -4 bytes   original=246 bytes, optimized=242 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/firefox_settings_alert.png
> -2% / -14 bytes   original=622 bytes, optimized=608 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/folder_closed.png
> -46% / -206 bytes   original=445 bytes, optimized=239 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/handle_end.png
> -24% / -174 bytes   original=707 bytes, optimized=533 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/handle_middle.png
> -21% / -187 bytes   original=890 bytes, optimized=703 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/handle_start.png
> -22% / -164 bytes   original=725 bytes, optimized=561 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/home_tab_menu_strip.9.png
> -6% / -6 bytes   original=96 bytes, optimized=90 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/reading_list_migration.png
> -37% / -2337 bytes   original=6208 bytes, optimized=3871 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/status_icon_readercache.png
> -39% / -273 bytes   original=688 bytes, optimized=415 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/suggestedsites_amazon.png
> -33% / -1955 bytes   original=5924 bytes, optimized=3969 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/suggestedsites_facebook.png
> -39% / -307 bytes   original=775 bytes, optimized=468 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/suggestedsites_twitter.png
> -48% / -853 bytes   original=1769 bytes, optimized=916 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/suggestedsites_wikipedia.png
> -40% / -1172 bytes   original=2874 bytes, optimized=1702 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/suggestedsites_youtube.png
> -33% / -1243 bytes   original=3686 bytes, optimized=2443 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/tab_indicator_selected.9.png
> -5% / -5 bytes   original=97 bytes, optimized=92 bytes
> 
> mobile/android/base/resources/drawable-xhdpi/tab_indicator_selected_focused.9.png
> -6% / -7 bytes   original=103 bytes, optimized=96 bytes
> 
> mobile/android/base/resources/drawable-xhdpi-v11/star_blue.png
> -2% / -26 bytes   original=1000 bytes, optimized=974 bytes
> 
> mobile/android/base/resources/drawable-xlarge-hdpi-v11/star_blue.png
> -3% / -24 bytes   original=685 bytes, optimized=661 bytes
> 
> mobile/android/base/resources/drawable-xlarge-xhdpi-v11/star_blue.png
> -3% / -26 bytes   original=794 bytes, optimized=768 bytes
> 
> mobile/android/base/resources/drawable-xlarge-xxhdpi-v11/star_blue.png
> -5% / -60 bytes   original=1193 bytes, optimized=1133 bytes
> 
> mobile/android/base/resources/drawable-xxhdpi/folder_closed.png
> -49% / -312 bytes   original=635 bytes, optimized=323 bytes
> 
> mobile/android/base/resources/drawable-xxhdpi/reading_list_migration.png
> -39% / -4120 bytes   original=10435 bytes, optimized=6315 bytes
> 
> mobile/android/base/resources/drawable-xxhdpi/status_icon_readercache.png
> -39% / -392 bytes   original=994 bytes, optimized=602 bytes
> 
> mobile/android/base/resources/drawable-xxhdpi/suggestedsites_amazon.png
> -34% / -3157 bytes   original=9225 bytes, optimized=6068 bytes
> 
> mobile/android/base/resources/drawable-xxhdpi/suggestedsites_facebook.png
> -39% / -459 bytes   original=1152 bytes, optimized=693 bytes
> 
> mobile/android/base/resources/drawable-xxhdpi/suggestedsites_twitter.png
> -53% / -1580 bytes   original=2932 bytes, optimized=1352 bytes
> 
> mobile/android/base/resources/drawable-xxhdpi/suggestedsites_wikipedia.png
> -43% / -1937 bytes   original=4456 bytes, optimized=2519 bytes
> 
> mobile/android/base/resources/drawable-xxhdpi/suggestedsites_youtube.png
> -33% / -1858 bytes   original=5537 bytes, optimized=3679 bytes
> 
> mobile/android/base/resources/drawable-xxhdpi-v11/ic_status_logo.png
> -8% / -117 bytes   original=1343 bytes, optimized=1226 bytes
> 
> mobile/android/base/resources/drawable-xxhdpi-v11/star_blue.png
> -4% / -67 bytes   original=1398 bytes, optimized=1331 bytes
> 
> mobile/android/base/resources/raw/bookmarkdefaults_favicon_restricted_webmaker.png
> -22% / -1249 bytes   original=5455 bytes, optimized=4206 bytes
> 
> mobile/android/services/src/main/res/drawable-hdpi/sync_desktop_inactive.png
> -0% / -2 bytes   original=211 bytes, optimized=209 bytes
> 
> mobile/android/themes/core/images/accessiblecaret-normal-hdpi.png
> -30% / -214 bytes   original=693 bytes, optimized=479 bytes
> 
> mobile/android/themes/core/images/accessiblecaret-normal-xhdpi.png
> -36% / -334 bytes   original=924 bytes, optimized=590 bytes
> 
> mobile/android/themes/core/images/accessiblecaret-normal-xxhdpi.png
> -37% / -523 bytes   original=1394 bytes, optimized=871 bytes
> 
> mobile/android/themes/core/images/accessiblecaret-tilt-left-hdpi.png
> -33% / -176 bytes   original=532 bytes, optimized=356 bytes
> 
> mobile/android/themes/core/images/accessiblecaret-tilt-left-xhdpi.png
> -38% / -271 bytes   original=706 bytes, optimized=435 bytes
> 
> mobile/android/themes/core/images/accessiblecaret-tilt-left-xxhdpi.png
> -40% / -462 bytes   original=1140 bytes, optimized=678 bytes
> 
> mobile/android/themes/core/images/accessiblecaret-tilt-right-hdpi.png
> -36% / -199 bytes   original=538 bytes, optimized=339 bytes
> 
> mobile/android/themes/core/images/accessiblecaret-tilt-right-xhdpi.png
> -36% / -242 bytes   original=668 bytes, optimized=426 bytes
> 
> mobile/android/themes/core/images/accessiblecaret-tilt-right-xxhdpi.png
> -40% / -442 bytes   original=1101 bytes, optimized=659 bytes
> 
> mobile/android/themes/core/images/checkbox_unchecked_disabled.png
> -1% / -2 bytes   original=135 bytes, optimized=133 bytes
> 
> mobile/android/themes/core/images/reader-style-icon-hdpi.png
> -35% / -320 bytes   original=891 bytes, optimized=571 bytes
> 
> mobile/android/themes/core/images/reader-style-icon-xhdpi.png
> -36% / -429 bytes   original=1179 bytes, optimized=750 bytes
> 
> mobile/android/themes/core/images/reader-style-icon-xxhdpi.png
> -39% / -713 bytes   original=1791 bytes, optimized=1078 bytes
> 
> mobile/android/themes/core/images/textfield.png
> -4% / -4 bytes   original=95 bytes, optimized=91 bytes
Some discussion on which optimization tools to use and precedent:
  https://mail.mozilla.org/pipermail/mobile-firefox-dev/2016-May/002043.html
You need to log in before you can comment on or make changes to this bug.