Page 1 of 1

Resizing .SVG input file

Posted: 2010-11-14T16:42:46-07:00
by Brad1011
I'm trying to take an input .svg file and resize it and output as a .png file. The problem is, when I output the file it looks all blurry because it looks like it was rasterized before being scaled.

Does anyone know how I can take an .svg file, resize it and save it as a .png in Magick++?


My current code is:

Code: Select all

    image.read( "Character.svg" );
	   image.resize("1000x1000");
    image.write( "xx.png" ); 
I've also tried playing around with density, but it didn't seem to help.

Anyone have any ideas on this?

Re: Resizing .SVG input file

Posted: 2010-11-14T20:49:27-07:00
by anthony
SVG is a vector language. BUT you need to specify the density (resolution) BEFORE you read the image as it is during the read that the rasterization happens.

See any Magick++ example that 'reads' a 'XC:' or 'canvas:' image file format. The method that example uses to set 'size' before reading (creating) the image, will be the same method used to set 'density'

WARNING: svg can specify some features in terms of 'pixels' and such features will NOT scale with density.