Skip to content

Instantly share code, notes, and snippets.

@BenjaminVerble
Created October 23, 2017 20:39
Show Gist options
  • Save BenjaminVerble/643de7d5ed5f35edce7d7752692d8101 to your computer and use it in GitHub Desktop.
Save BenjaminVerble/643de7d5ed5f35edce7d7752692d8101 to your computer and use it in GitHub Desktop.
print from chrome to see bad rasterization of svg pattern
<html>
<body>
<svg width="120" height="120" viewBox="0 0 120 120"
xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="Triangle" width="10" height="10"
patternUnits="userSpaceOnUse">
<polygon points="5,0 10,10 0,10"/>
</pattern>
</defs>
<circle cx="60" cy="60" r="50" fill="url(#Triangle)"/>
</svg>
</body>
</html>
@lmartins
Copy link

@BenjaminVerble did you find a solution to this? Seeing the same problem when trying to generate PDF's, where everything stays vector except for the contents of the pattern fills.

@Syndesi
Copy link

Syndesi commented Feb 15, 2020

Setting the opacity of the element to 0.99 solves the bug, tested with Chrome 79 and inline SVG.
Source: https://stackoverflow.com/a/45911373/4417327

@karl-run
Copy link

karl-run commented Sep 3, 2020

Damn, I've wrestled with this for hours and found randomly this gist when I changed my Google search to include "rasterisation" instead of "blurry".

Can verify that this still is an issue in Chrome 85 and setting opacity to 0.99 fixes it, if anyone else comes across this gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment