Hello all,
When ImageMagick takes a svg file does it convert to something of its own?
Using the following command
composite -compose atop -background none -geometry +200+200 red_circle.svg helloWorld.jpg output.jpg
The red circle in the output looks crisp and clear as expected, however, when we add the -resize flag...
composite -compose atop -background none -geometry +200+200 red_circle.svg -resize 1000x1000 helloWorld.jpg output.jpg
The circle appears to be rasterized with visible pixelation.
Any ideas? or am I missing a step here? Seems like theres gotta be a way for IM to 'open' the svg at a certain size % and I'm just missing the flag
TIA
-Rick
SVG composites: are SVGs not really scalable in ImageMagick?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
The reason for the 'pixelation' is that the vector image was first converted to a raster image, then it was resized. By setting -density BEFORE reading in the SVG image you specy the number of pixels per inch the SVG draws. As such using a -density 600 on a small 1 inch circle will generate a perfect 600 pixel circle, when the SVG is converted to a raster image.
For more details see
A word about Vector Image formats
http://www.cit.gu.edu.au/~anthony/graph ... ts/#vector
As for your first question.
However IM can also use an extenal delegate to do the conversion from SVG to a raster, either using an extrnel delegate program like "rsvg" or the gnome gtk-2 SVG library, that has since become common.
I am however not sure how you can telll what method IM uses to do this, or what the internals are as I have not looked. I have only seen tantalizing clues as to what is happening due to error messages in some of my tests, and the 'deletage' list.
Cristy, can you enlighten use further on the current SVG coding status within IM?
For more details see
A word about Vector Image formats
http://www.cit.gu.edu.au/~anthony/graph ... ts/#vector
As for your first question.
Yes IM will use a internal vector format as a intermediate step to converting the image to a raster format. It is talked about in IM Examples as this language is often a lot simpler and easier to understand than SVG format.When ImageMagick takes a svg file does it convert to something of its own?
However IM can also use an extenal delegate to do the conversion from SVG to a raster, either using an extrnel delegate program like "rsvg" or the gnome gtk-2 SVG library, that has since become common.
I am however not sure how you can telll what method IM uses to do this, or what the internals are as I have not looked. I have only seen tantalizing clues as to what is happening due to error messages in some of my tests, and the 'deletage' list.
Cristy, can you enlighten use further on the current SVG coding status within IM?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Thanks. I have updated the appropriate parts of the 'Drawing' section of the IM examples, with that qualification.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/