SVG-as-an-image is quite blurry when used as CSS Background in a printed document, especially at reduced print scales
Categories
(Core :: Printing: Output, defect)
Tracking
()
People
(Reporter: csasca, Unassigned)
Details
Attachments
(9 files)
Affected versions
- Firefox 91.10.0 ESR
- Firefox 101.0
- Firefox 102.0a1
Affected platforms
- macOS 11.6.6
- Windows 11
- Ubuntu 22.04
Steps to reproduce
- Launch Firefox
- Access Wikipedia
- Print the page and check the "print background" setting
- Select from the Pages per sheet ~4 or more pages and print to pdf
Expected result
- The content is not blurred out
Actual result
- Some of the in page content is blurred out and the effect is stronger if selecting more pages per sheet.
Regression range
- WIll see for a regression
Additional notes
- The issue can be seen in the attachment
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 1•2 years ago
|
||
The blurry things are all background-images that are painted using this sprite sheet.
Reduced testcase coming up.
Comment 2•2 years ago
|
||
Comment 3•2 years ago
|
||
Here's a Save-to-PDF printout of testcase 1 (with the checkbox for "print backgrounds" checked).
The right copy of the image (the one with the CSS background) is noticeably blurrier. So something about our "paint svg image as CSS background" codepath is failing us here; we're painting at the wrong resolution or something.
Comment 4•2 years ago
|
||
Here's the testcase again, now with "Scale: 50%" chosen in the print preview dialog (similar to comment 0's described multiple-pages-per-sheet setup). This makes the blurriness more visible.
Comment 5•2 years ago
|
||
For convenience, here's a quick screenshot showing the blurriness in that most recent 50%-scale PDF printout.
Updated•2 years ago
|
Comment 6•2 years ago
|
||
Comment 7•2 years ago
|
||
Comment 8•2 years ago
|
||
Comment 9•2 years ago
|
||
Testcase 2 uses "image-rendering: crisp-edges", which helps make it clearer that we're rasterizing the image at too small of a resolution and then scaling it up. (You can see the individual jaggy scaled-up pixel squares.)
Updated•2 years ago
|
Comment 10•2 years ago
|
||
One would think that this would make it a crisp path?
Comment 11•2 years ago
|
||
With testcase 1 and testcase 2, I get this regression range:
Last good revision: 82df3654cd80 (2014-07-23)
First bad revision: a91ec42d6a9c (2014-07-24)
Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=82df3654cd80&tochange=a91ec42d6a9c
...but actual-Wikipedia still looks broken, so there's an additional factor that's triggering the pixellation there.
It looks like the relevant thing missing in my testcases (to trigger badness in older builds) is background-position
-- if I set that to a nondefault value on testcase 2, then I get fuzziness even in my "good" 2014-07-23 nightly.
Comment 12•2 years ago
|
||
With background-position: -2px -8px
added to the css-background part of testcase 2, it looks like I get "actual results" as far back as I can usefully test, which is around 2011-01-01, Firefox 4 prerelease builds.
Comment 13•2 years ago
•
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #10)
One would think that this would make it a crisp path?
You would think, yeah! It looks like that was part of a fix for <img>
being pixelated under some circumstances, in bug 1003505, which was a regression from bug 764299.
If I test a build from inside that range (the range when bug 1003505 was a problem), e.g. Nightly 2013-10-23 or 2014-06-20, then my PDF-printout of testcase 2 looks "consistently fuzzy" -- the top part (img) and bottom (css background) are both fuzzy. :)
But builds just-before or just-after that range look pretty much the same as they do now -- the top is crisp, the bottom is fuzzy.
Comment 14•2 years ago
|
||
--> Clearing regressionwindow-wanted
since this is not really a regression, per comment 11. It goes back as far as I can usefully test.
Updated•2 years ago
|
Description
•