Make "image-rendering: pixelated" use a better downscaling algorithm
Categories
(Core :: Graphics: ImageLib, defect)
Tracking
()
People
(Reporter: dholbert, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(6 files, 2 obsolete files)
4.30 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
15.47 KB,
patch
|
Details | Diff | Splinter Review | |
22.26 KB,
patch
|
seth
:
review+
|
Details | Diff | Splinter Review |
156 bytes,
image/png
|
Details | |
1.79 KB,
text/html
|
Details | |
6.44 KB,
image/png
|
Details |
Comment 1•10 years ago
|
||
Reporter | ||
Comment 2•10 years ago
|
||
Reporter | ||
Comment 3•10 years ago
|
||
Reporter | ||
Comment 4•10 years ago
|
||
Reporter | ||
Comment 5•10 years ago
|
||
Reporter | ||
Updated•10 years ago
|
Comment 6•10 years ago
|
||
Reporter | ||
Comment 7•10 years ago
|
||
Comment 8•10 years ago
|
||
Comment 9•10 years ago
|
||
Reporter | ||
Comment 10•10 years ago
|
||
Reporter | ||
Comment 11•10 years ago
|
||
Reporter | ||
Comment 12•10 years ago
|
||
Reporter | ||
Comment 13•10 years ago
|
||
Reporter | ||
Comment 14•10 years ago
|
||
Reporter | ||
Comment 15•10 years ago
|
||
Reporter | ||
Comment 16•10 years ago
|
||
Reporter | ||
Comment 17•10 years ago
|
||
Comment 18•10 years ago
|
||
Reporter | ||
Comment 19•9 years ago
|
||
Reporter | ||
Comment 20•4 years ago
|
||
Note: per https://github.com/w3c/csswg-drafts/issues/5837#issuecomment-785259691 , it looks like the pixelated
spec text is being extended so that the "smarter downscaling algorithm" will be applied at any non-exact pixel value (not just downscales) -- e.g. for 2.5x upscale, now the spec will call for doing something like nearest-neighbor to 2.0x or 3.0x, followed by a smarter scaling algorithm to reach the 2.5x target.
Comment 21•3 years ago
|
||
Daniel, is this still relevant with WR fully deployed? Emilio and I were talking through this relative to FFXP-604. Thoughts, feedback?
Reporter | ||
Comment 22•3 years ago
|
||
Here's a copy of https://searchfox.org/mozilla-central/source/layout/reftests/backgrounds/aqua-yellow-32x32.png which I'll use in a testcase here.
Reporter | ||
Comment 23•3 years ago
|
||
Reporter | ||
Comment 24•3 years ago
|
||
Reporter | ||
Comment 25•3 years ago
•
|
||
I've just posted a testcase[1] to demonstrate the issue that we would hypothetically be solving here. Essentially: our image-scaling:pixelated
implementation looks considerably-worse than the default scaling algorithm when we downscale. With the image I'm using, it introduces breaks in the black diagonal "slash"; and in the second-to-last line, the diagonal "slash" disappears entirely.
Having said that, I have a few observations which lead me to believe we can close this:
(A) Chromium and WebKit have the same or similar downscaling artifacts on this testcase, so this isn't a case where we've fallen behind them, at least.
(B) The CSSWG resolution that prompted me to file this bug never actually made it into the spec, unfortunately (as I mentioned in https://github.com/w3c/csswg-drafts/issues/5837#issuecomment-785619937 )
(C) The spec has evolved a bit so that now pixelated will have an "optional better-than-Nearest-Neighbors behavior" for other fractional scale-factors as well (not just < 1), as noted in comment 20.
All three of these factors lead me to believe we should just close this out. I'll file a new (not-high-priority) bug on optionally coming up with a better scaling behavior for fractional scaling factors, and I'll duplicate this bug forward to that new bug, as its spiritual successor.
[1] Brief overview of the testcase: it shows the same image, with default image-scaling
on the left and image-scaling:pixelated
on the right, at a variety of sizes:
- the default size
- scaled up by 4x (to 128px in size), just to double-check that
pixelated
is doing something. - scaled down to a variety of widths
Reporter | ||
Comment 26•3 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #25)
All three of these factors lead me to believe we should just close this out. I'll file a new (not-high-priority) bug on optionally coming up with a better scaling behavior for fractional scaling factors, and I'll duplicate this bug forward to that new bug, as its spiritual successor.
--> Duping forward to bug 1731134
Description
•