Open Bug 821450 Opened 13 years ago Updated 3 years ago

Add dithering support for opaque images

Categories

(Core :: Graphics: ImageLib, defect, P5)

x86
macOS
defect

Tracking

()

blocking-kilimanjaro ?
Tracking Status
fennec + ---

People

(Reporter: jrmuizel, Unassigned)

References

Details

(Whiteboard: [tech-p2])

Attachments

(3 files, 1 obsolete file)

This shouldn't be too hard and might be worth doing. There will of course be a performance impact, but might not be too bad if we do during conversion to 16bit surfaces.
blocking-kilimanjaro: --- → ?
Blocks: 803299
tracking-fennec: --- → ?
Jeff, can you comment as to how much this will help and if we should track it for release?
Flags: needinfo?(jmuizelaar)
(In reply to Brad Lassey [:blassey] from comment #1) > Jeff, can you comment as to how much this will help and if we should track > it for release? It's hard to say how much it will help, without specific problems that we want to address. I would suggest not tracking it for release.
Flags: needinfo?(jmuizelaar)
Attached patch Working versionSplinter Review
Attachment #702659 - Attachment is obsolete: true
qawanted to compare the results from this with the problem images they've identified
Keywords: qawanted
Pushed this as https://tbpl.mozilla.org/?tree=Try&rev=68560043a297 now to find a few representative images.
We have a really badly banded image in prime real estate in the b2g UI. I'll grab before/after screenshots as soon as I can. (We're separately working around this with <canvas> for v1.)
I don't see a difference. Maybe we have to stick this somewhere else in the pipeline too?
(In reply to Chris Jones [:cjones] [:warhammer] from comment #8) > Created attachment 703764 [details] > left: without, right: with > > I don't see a difference. Maybe we have to stick this somewhere else in the > pipeline too? The banding on this comes from compositing the gradient mask and the wallpaper together. To fix that, I think we'd need a fully dithered pipeline which is unlikely to be performant enough.
(In reply to Chris Jones [:cjones] [:warhammer] from comment #8) > Created attachment 703764 [details] > left: without, right: with > > I don't see a difference. Maybe we have to stick this somewhere else in the > pipeline too? I was also talking with Patryk and Peter about this particular case and it sounds like we may just solve it by using a solid color dim instead of a gradient mask.
We have a <canvas> hack that gets the job done.
(In reply to Chris Jones [:cjones] [:warhammer] from comment #11) > We have a <canvas> hack that gets the job done. That comes at the cost of having to blend the 'opaque' canvas with what is underneath it. Probably not a big a deal, but things like this add up.
Pushed this as https://tbpl.mozilla.org/?tree=Try&rev=68560043a297 now to find a few representative images.
tracking-fennec: ? → +
Important use case for content; content doesn't seem to generally ship dithered resources so they look bad on low-end screens.
Whiteboard: [tech-p2]
Dropping qawanted since the request was accomplished in comment 8.
Keywords: qawanted
Attached image gradients.png
Would this also fix the rendering of this testcase? The middle column should look like the right one.
(In reply to The 8472 from comment #16) > Created attachment 8503355 [details] > gradients.png > > Would this also fix the rendering of this testcase? The middle column should > look like the right one. What is the test case from?
I generated it with imagemagick. It's a 16bit PNG with gradients between shades of green. The first column is with color steps truncated to 8bit precision, the second column with full 16bit precision and the 3rd column with the same 16bit gradient dithered to 8bit. Assuming an 8bit output device and no dithering the 2nd column will look like the 1st column, i.e. banded But ideally the 2nd column should look like the 3rd column.
filter on [mass-p5]
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: