New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 659522 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

The NTP all dismissed illustration adds ~100k

Project Member Reported by mvanouwe...@chromium.org, Oct 26 2016

Issue description

It should add less, probably, for an image that is not displayed very often.

See: https://codereview.chromium.org/2430383003/#msg12

Ideas:
* Moar png optimization
* WebP (does that work in Android native UI?)
* Vector format
* Create a smaller, simpler illustration

 
Cc: agrieve@chromium.org

Comment 2 by rachelis@google.com, Oct 26 2016

Cc: bettes@chromium.org
Oh no! +bettes also, FYI

Comment 3 by rachelis@google.com, Oct 26 2016

Can we use a single image and scale down?

Alan also suggests converting to WebP - but we don't know that much about that. Do you just need a file from us?


Comment 4 by rachelis@google.com, Oct 26 2016

Here is a webp file - it went from 49kb to 25. :)
empty_xxxhdpi.webp
21.8 KB View Download

Comment 5 by fi...@chromium.org, Oct 27 2016

Labels: zine-client-ux-v1 zine-triaged M-56
Status: Assigned (was: Untriaged)
webp without transparency (which this image doesn't seem to have) is supposed to "just work" on all Android versions that we support. I think that'd be the easiest way to reduce the size (should be able to just delete the .png and add in the .webp of the same name)

Comment 7 by rachelis@google.com, Oct 27 2016

Sounds good! Any downsides?
Only downside I can think of is that it takes longer to decode the image. I don't think this will be noticeable though.

Comment 9 by nepper@chromium.org, Oct 27 2016

Labels: -zine-pm
Is the gray background in the webp version still the right color - or did it get compressed into a different color code? (Just trying to avoid we will see a difference between the image and the actual background).

Removing PM label - I think I'm useless here :)
Just had a look - this looks good to me.
Labels: zine-16-11-07
Status: Started (was: Assigned)
According to [1] lossless webp is only supported from Android 4.2.1, and we need to support 4.1. So, we can only use the lossy webp format, which may or may not be more efficient than a simple jpg. Perhaps going lossy is the way to go for this image... Rachel, what kind of settings did you use for the image in comment #4 ? And how does the file size compare to a jpg?

[1] https://developer.android.com/guide/appendix/media-formats.html#core
A 26KB jpg, sized at xxxhdpi, is attached to support android 4.1 and up. 

Display sizes:
mdpi - 112
hdpi - 168
xhdpi - 224 
xxhdpi - 336
xxxhdpi - 448

empty_xxxhdpi.jpg
25.6 KB View Download
Just played with this a bit for lossy web-p:
1. Get binary from: https://developers.google.com/speed/webp/docs/precompiled
2. Convert from .png via:
convert chrome_android_java_res_drawable_xxxhdpi_ntp_all_dismissed.png -quality 80 -define webp:lossless=false lossy80.webp

To me, the lossy webp@80 looks better than the jpg here.
lossy80.webp
17.4 KB View Download
lossy70.webp
13.3 KB View Download
lossy50.webp
10.3 KB View Download
lossy85.webp
21.8 KB View Download
Thanks guys. Rachel asked me to refrain from doing my own exports as these things need to be approved through ui review. So: Alan, could you please provide the exports for all resolutions, in the format you prefer?
Hey Alan - would you mind having a look at this?
Yeah webp80 in #14 LGTM. Thanks!
Labels: -zine-ux
Labels: zine-ux
Rachel, can you provide me with the exported assets, or the masters to export them from so I can do it myself? Or should I just use the old png files as input?
Andrew, I think we may need to reconsider using webp. It seems to have a file size advantage, but at a significant cost of decoding speed. Lossy webp may decode as much as 2x slower than jpg: https://goo.gl/7Du4wN
Certainly up to you. I knew they were slower, but figured it'd still be fast enough.
It's actually possible that they'd be faster in some real-world cases, as Android devices (especially cheap ones) tend to have super slow IO, yet still decent CPUs.
If there are assets still neeeded here, that aren't already included in this bug, make me the owner to get my attention. 
We (UX) need details about the correct way to export it if a new export is needed. I'll follow up with Michael. 
Project Member

Comment 25 by bugdroid1@chromium.org, Jan 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1afd533c0b1cc9243871660ff3b289990197d3fc

commit 1afd533c0b1cc9243871660ff3b289990197d3fc
Author: mvanouwerkerk <mvanouwerkerk@chromium.org>
Date: Mon Jan 09 11:02:11 2017

Use lossy webp format at q 80 for NTP all dismissed illustration.

mdpi: 4794 -> 2448
hdpi: 9225 -> 4104
xhdpi: 14893 -> 6214
xxhdpi: 29770 -> 11596
xxhdpi: 45532 -> 15582
total: 104214 -> 39944 bytes

BUG= 659522 

Review-Url: https://codereview.chromium.org/2615243002
Cr-Commit-Position: refs/heads/master@{#442231}

[delete] https://crrev.com/df739f207554939d0079fac838283c18b8ecb53e/chrome/android/java/res/drawable-hdpi/ntp_all_dismissed.png
[add] https://crrev.com/1afd533c0b1cc9243871660ff3b289990197d3fc/chrome/android/java/res/drawable-hdpi/ntp_all_dismissed.webp
[delete] https://crrev.com/df739f207554939d0079fac838283c18b8ecb53e/chrome/android/java/res/drawable-mdpi/ntp_all_dismissed.png
[add] https://crrev.com/1afd533c0b1cc9243871660ff3b289990197d3fc/chrome/android/java/res/drawable-mdpi/ntp_all_dismissed.webp
[delete] https://crrev.com/df739f207554939d0079fac838283c18b8ecb53e/chrome/android/java/res/drawable-xhdpi/ntp_all_dismissed.png
[add] https://crrev.com/1afd533c0b1cc9243871660ff3b289990197d3fc/chrome/android/java/res/drawable-xhdpi/ntp_all_dismissed.webp
[delete] https://crrev.com/df739f207554939d0079fac838283c18b8ecb53e/chrome/android/java/res/drawable-xxhdpi/ntp_all_dismissed.png
[add] https://crrev.com/1afd533c0b1cc9243871660ff3b289990197d3fc/chrome/android/java/res/drawable-xxhdpi/ntp_all_dismissed.webp
[delete] https://crrev.com/df739f207554939d0079fac838283c18b8ecb53e/chrome/android/java/res/drawable-xxxhdpi/ntp_all_dismissed.png
[add] https://crrev.com/1afd533c0b1cc9243871660ff3b289990197d3fc/chrome/android/java/res/drawable-xxxhdpi/ntp_all_dismissed.webp

Labels: -zine-ux
Thanks Michael.
Status: Fixed (was: Started)
Labels: apk-size

Sign in to add a comment