Set static SVG resolution (or get resolution prior to reading)
Posted: 2016-09-20T18:48:39-07:00
Using setResolution, you can adjust the density prior to reading in an SVG. As the comment at the bottom notes, this is set in relation to the current resolution.
I'm trying to adjust the resolution to 300DPI. In my environment (and as is noted in the documentation), the default resolution is 90 DPI. Because of this, setResolution(300, 300) renders an image that falls short of what the geometry should be. I have to use 375,375 to fill the area as expected. However, a client's environment may be 72 DPI, because that same code caused the resulting sections to clip outside of the bounding box set for it, and setResolution(300,300) is the only way to get equivalent output.
How can I tell ImageMagick to use the proper resolution so that quality is retained and the geometry is the same, no matter which environment I am in?
I'm trying to adjust the resolution to 300DPI. In my environment (and as is noted in the documentation), the default resolution is 90 DPI. Because of this, setResolution(300, 300) renders an image that falls short of what the geometry should be. I have to use 375,375 to fill the area as expected. However, a client's environment may be 72 DPI, because that same code caused the resulting sections to clip outside of the bounding box set for it, and setResolution(300,300) is the only way to get equivalent output.
How can I tell ImageMagick to use the proper resolution so that quality is retained and the geometry is the same, no matter which environment I am in?