Closed Bug 1081103 Opened 11 years ago Closed 4 years ago

Treat transparent pixels as white when computing dominant colors

Categories

(Firefox for Android Graveyard :: Favicon Handling, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: heycam, Unassigned)

Details

Attachments

(3 files)

See the attached screen shot where the favicon for reddit doesn't look so great. Two things stand out to me. One is that it seems like blue is the more dominant colour than red. The other is that it'd probably look nicer if the favicon were drawn on top of the coloured square, rather than behind it.
Attached image screen shot
Attached image wfm.png
How are you even running into that? As far as I'm aware we don't do dominant colouring anymore. On trunk, I get http://www.redditstatic.com/icon.png See screenshot.
(In reply to Aaron Train [:aaronmt] from comment #2) > How are you even running into that? As far as I'm aware we don't do dominant > colouring anymore. On trunk, I get http://www.redditstatic.com/icon.png I don't know. :-) Could it be something that my profile picked up ages ago, when we used to do dominant colour stuff? In case it makes a difference, this is for i.reddit.com rather than www.reddit.com.
I've got a bunch of other sites in my Top Sites/Bookmarks/History that show low res favicons with a coloured semi-transparent square on top of them, so this isn't reddit-specific I guess.
I can repro in Nightly. The favicon isn't big enough for two line page view, even if it's enough for the url bar.
I think there are two bugs here: * We don't really want a dominant color: we want a suitable background color. The dominant color is just an approach we're using to approximate that, because most icons are on a flat background color. This icon's dominant color -- thanks to its transparent background! -- is red. That probably means we should treat transparent as *white* when computing the background color. Let's use this bug for that. * There are issues when overlaying a transparent icon on its dominant color. The dominant color approach was to fill in the gap around an opaque icon, not to effectively 'tint'.
Summary: favicon for reddit doesn't look pretty → Treat transparent pixels as white when computing dominant colors
The algorithm does try to throw out colors that are outside some threshold: http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/gfx/BitmapUtils.java#301 which I assume is why its not picking up the reddit blue either. We have a flag there to turn this off, but I don't see us using it anywhere anymore. Maybe we flip it. Or maybe those restrictions are just too loose. Or maybe they shouldn't be there at all....
To be honest I think the small favicons would probably look better without a coloured overlay at all, and just rendered at double size using image-rendering:pixelated, but I guess that's not a discussion for this bug. This is effectively what we do in the tabs on Desktop on HiDPI machines.
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
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: