Page 1 of 1

Rending high dpi svg then downsampling - sensible?

Posted: 2018-01-17T23:39:58-07:00
by moocow89
Hi,

I've programatically generated a 60 meg SVG file and am using IM to render it to PNG with the intent of ultimately getting it professionally printed. The generated image pretty much entirely consists of fine lines at all angles.

If I render at a density of 300 (using SVG shape-rendering:crispEdges to disable anti-aliasing) the fine-line jaggies are clearly visible and look ugly.
If I render with "shape-rendering:geometricPrecision" this allows anti-aliasing but the image is unpleasantly blurred.

I've been trying rendering at a high dpi (1800 with svg:crispEdges) and then resampling the resultant png back down to 300, with the hope that IM will do a better job this way than any permutation of straight rending at 300. The generated images appear better to me - but is it a sensible approach? Is there more I could do to improve the final 300dpi output? (for example, I'm noticing moire patterns to a greater or lesser extent depending upon the density I use - is there any way to avoid those?)

(as an aside, I'm really impressed with the power of IM - a big thank you for all the hard work that's gone into it)

Re: Rending high dpi svg then downsampling - sensible?

Posted: 2018-01-18T01:10:38-07:00
by fmw42
try

Code: Select all

convert -density 1800 image.svg -resize WxH image.png
where WxH is your desired PNG dimensions. This is a typical process for converting SVG to raster format. The density must come before reading the svg.