Closed gfmio closed 4 years ago
Hi, did you see the density
option of the constructor?
Thanks, @lovell, that worked! But why is that configuration parameter necessary? And does that mean that whenever I'm rescaling, I need to calculate the appropriate density factor depending on the original and final resolution?
Great, please see #1421 for some previous discussion about this.
I've just written a function for Scaling SVGs: https://github.com/lovell/sharp/issues/1421#issuecomment-813645061
Are you using the latest version? Is the version currently in use as reported by
npm ls sharp
the same as the latest version as reported bynpm view sharp dist-tags.latest
?What are the steps to reproduce?
Take any SVG and try to scale it to a size that is bigger than its view box.
The output is blurry, because it seems the SVG is first rendered as a bitmap of the size of the original view box and then the bitmap is scaled.
What is the expected behaviour?
The image is as crisp as the bitmap size allows, i.e. the SVG is rendered straight onto the enlarged bitmap.
Are you able to provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem?
Are you able to provide a sample image that helps explain the problem?
Input SVG:
Expected output (generated using Illustrator):
Actual output:
What is the output of running
npx envinfo --binaries --system
?