Page 1 of 1

Conversion of text containing svg file to png doesn't works!

Posted: 2014-05-20T06:48:01-07:00
by Ganesha
While converting Text contained svg file to png I got a blank png image as a result . The file is totally blank . Is there any solution for converting text containing svg file to png?

Re: Conversion of text containing svg file to png doesn't wo

Posted: 2014-05-20T07:48:54-07:00
by snibgo
Please say what version of IM and platform you are using.

Please tell us the exact command you used.

Please supply an SVG file that shows the problem. Paste the contents here between [ code ] and [ /code ].

Re: Conversion of text containing svg file to png doesn't wo

Posted: 2014-05-20T10:33:36-07:00
by fmw42
Topic moved to the correct forum.

Re: Conversion of text containing svg file to png doesn't wo

Posted: 2014-05-27T03:58:18-07:00
by Ganesha
I am using IM 6.8.9-0 and MAC.
The command is

Code: Select all

 "convert Shapefont.svg  -resize 770x515! -quality 100 test1.png
Here the text file:
https://dl.dropboxusercontent.com/s/7rh ... 1401191582
-----
output file -
https://www.dropbox.com/s/r65xbmiktok2ylk/test1.png

Re: Conversion of text containing svg file to png doesn't wo

Posted: 2014-05-27T07:02:46-07:00
by snibgo
Your command makes no sense. It has an input with no output. (Or perhaps an output with no input.)

You haven't pasted the contents of your SVG file between [ code] and [ /code] markers.

Re: Conversion of text containing svg file to png doesn't wo

Posted: 2014-07-31T23:54:06-07:00
by Ganesha
Sorry that was typo error can you check now @snibgo

Re: Conversion of text containing svg file to png doesn't wo

Posted: 2014-08-01T04:21:53-07:00
by snibgo
The SVG specifies a viewbox of 6.47 x 2.32 pixels. So that is the size of the generated image, rounded to 6x2 pixels. When you resize this to 770x515, the image is not interesting.

The default density for SVG is 90 dpi. To render the width as 770 pixels, multiply the density by 770/6.47. So you want a density of 90*770/6.47 = 10710.97

Code: Select all

convert -density 10710.97 shapefont.svg s.png
The result is better, though not correct. Rather than use such extreme densities, it would be better to fix the SVG. What created it?

(My tests used IM v6.8.9-5 using Inkscape to render the SVG.)