Closed Bug 1998144 Opened 4 months ago Closed 4 months ago

Fill with gray pixels for partially rendered images

Categories

(Core :: Graphics: ImageLib, enhancement)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1556156

People

(Reporter: saschanaz, Unassigned)

Details

Attachments

(1 obsolete file)

Currently partially decoded JPEG images are filled with white pixels, if such image is not encoded in a progressive format. It would be nice if we can use black pixels on dark mode instead.

For example, it's sometimes annoying if you load a high resolution non-progressive JPEG file served from an abroad Mastodon server that is not cached by any CDN. Clicking such image would temporarily fill your mobile screen with bright white pixels.

Component: Layout: Images, Video, and HTML Frames → Graphics: ImageLib

Bug 1556156 is the bug to draw these pixels as transparent like we used to before webrender. It needs some work on the web render side to work.

Here is the place where we clear to white
https://searchfox.org/firefox-main/rev/f6385e6644d5d4343d33b692810275c434122199/image/imgFrame.cpp#112

See Also: → 1556156

Transparent pixels would be much better. But if that's hard I would be happy to have black pixels until we get to that.

Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED

Err that was a mistake

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → NEW

(the question is, is it really easier to detect dark mode from image frame instead of doing transparency unconditionally? 🤔)

Or we could use gray pixels regardless of the color mode.

This would also not solve cases like bug 1808149 where the website itself is using black type theme even in light mode.

Gray sounds like the better fallback in that case, and also just easier.

Summary: Fill with black pixels for partially rendered images on dark mode → Fill with gray pixels for partially rendered images

Well, I tried filling 0x33, but that ended up being glassy gray. Then I tried 0 which made it fully transparent. Huh?

Attachment #9524929 - Attachment is obsolete: true

Giving up on this, can't do anything other than 0xFF without causing weird issue, as tnikkel said... Let's do bug 1556156 🙂

Status: NEW → RESOLVED
Closed: 4 months ago4 months ago
Duplicate of bug: 1556156
Resolution: --- → DUPLICATE
See Also: 1556156
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: