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

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

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

Post 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?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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 ].
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

Topic moved to the correct forum.
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

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

Post 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
Last edited by Ganesha on 2014-07-31T23:59:06-07:00, edited 2 times in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

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

Post by Ganesha »

Sorry that was typo error can you check now @snibgo
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.)
snibgo's IM pages: im.snibgo.com
Post Reply