Page 1 of 2
Conversion from svg to pdf results in a bitmap
Posted: 2006-04-26T17:39:38-07:00
by donovaly
When I convert a svg-image to a pdf-image with the command
convert test.svg test.pdf
I get a bitmap image instead of a vector image. This destroys the advantage of svg's.
The resulting bitmap looks btw. very poor:
Test svg:
http://fkurth.de/uwest/LyX/test.svg
Resulting pdf:
http://fkurth.de/uwest/LyX/test.pdf
Resulting png:
http://fkurth.de/uwest/LyX/test.png
Posted: 2006-04-26T20:49:23-07:00
by magick
ImageMagick rasterizes vector images. We have infastructure to retain vector information but its far from complete. In this case, you probably want to use a different program than ImageMagick.
Posted: 2006-04-27T05:11:37-07:00
by donovaly
[quote="magick"]ImageMagick rasterizes vector images.ImageMagick.[/quote]
Hello magick,
thanks for the info. I could live with a raster image when it is in a viewable state. Have a look at the resulting png I postesd and compare it to the png that is produced when you convert the test.svg with e.g. Inkscape. It seems that Imagemagick just rasters them with a bad pixel resolution.
Posted: 2006-04-27T06:46:04-07:00
by magick
Try this command:
- convert -density 300 test.svg test.png
Posted: 2006-04-27T07:19:16-07:00
by donovaly
[quote="magick"]Try this command: [list]convert -density 300 test.svg test.png[/list][/quote]
This leads to a horrible output. When I try this with the test.svg I get huge letters displayed all over the place above the diagram. A bug I guess.
Posted: 2006-04-27T10:03:54-07:00
by magick
We got very good looking results. Does your version of ImageMagick include Freetype support? Type
to determine if its included. We're using ImageMagick 6.2.7-1.
Posted: 2006-04-28T02:58:38-07:00
by donovaly
magick wrote:
Does your version of ImageMagick include Freetype support? Type
to determine if its included. We're using ImageMagick 6.2.7-1.
I'm also using 6.2.7-1 but identify tells me that I have 6.2.4:
Name Value
-------------------------------------------------------------------------------
COPYRIGHT Copyright (C) 1999-2005 ImageMagick Studio LLC
HOST Windows
LIB_VERSION 0x624
LIB_VERSION_NUMBER 6,2,4,4
NAME ImageMagick
RELEASE_DATE 09/01/05
VERSION 6.2.4
WEBSITE
http://www.imagemagick.org
the command:
convert -density 300 test.svg test.png
gives me this result:
http://james.physik.uni-freiburg.de/~stoehr/test.png
Posted: 2006-04-28T03:02:50-07:00
by donovaly
Btw. Inkscape produces a correct output:
http://james.physik.uni-freiburg.de/~stoehr/foo.png
You can see that Imagemagick has also a problem with the image size when I use the -density option
Posted: 2006-04-28T06:51:36-07:00
by magick
If ImageMagick reports 6.2.4 that is the version you are using. You may have two versions of ImageMagick installed and are using the wrong one. When we convert your SVG with ImageMagick 6.2.7-1 we get the same results as you posted with Inkscape.
Posted: 2006-04-28T18:01:34-07:00
by donovaly
[quote="magick"]If ImageMagick reports 6.2.4 that is the version you are using. You may have two versions of ImageMagick installed and are using the wrong one. When we convert your SVG with ImageMagick 6.2.7-1 we get the same results as you posted with Inkscape.[/quote]
Then you packed a wrong version to the 6.2.7-1 win-installer:
I deinstalled IM completely and also removed everything from the PATH and the registry and tried out the installer from different official mirrors. I always get
---------------------
C:\Documents and Settings\muso>identify -list configure
Path: C:\Program Files (x86)\ImageMagick-6.2.7-Q16\config\configure.xml
Name Value
-----------------------------------------------------------------------
COPYRIGHT Copyright (C) 1999-2005 ImageMagick Studio LLC
HOST Windows
LIB_VERSION 0x624
-----------------------------
but I also always get this:
-------------
C:\Documents and Settings\muso>identify -version
Version: ImageMagick 6.2.7 04/14/06 Q16
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
Posted: 2006-04-28T18:58:40-07:00
by magick
You are correct. Unix automagically updates the configure information but a manual edit is required under Windows. Thanks for alerting us to this problem.
Posted: 2006-04-30T12:25:05-07:00
by donovaly
magick wrote:
You are correct. Unix automagically updates the configure information but a manual edit is required under Windows. Thanks for alerting us to this problem.
With the new IM 6.2.7-2 I got now a correct output for
identify -list configure
I also get now a nice looking png also without the -depth 300 option.
Many thanks for your prompt help!
There's now only one problem left: Converting the test.svg to ppm leads to a wrong output when the conversion is done directly with
convert test.svg test.ppm
This is what I get:
http://fkurth.de/uwest/LyX/svg2ppm.ppm
When I convert the svg first to e.g. jpg and then to ppm I get a correct output:
http://fkurth.de/uwest/LyX/svg2jpg2ppm.ppm
Posted: 2006-04-30T13:30:54-07:00
by magick
JPEG is uses lossy compression so there are some differences in the output as expected. However, we can't identify what you are calling "wrong output." What about the direct conversion differs from that of first converting to JPEG?
Posted: 2006-04-30T15:53:42-07:00
by donovaly
magick wrote:
What about the direct conversion differs from that of first converting to JPEG?
I know that jpg uses lossy compression but jpg was only an example. Here you have the result when you first convert the svg to gif and then to ppm:
http://fkurth.de/uwest/LyX/svg2gif2ppm.ppm
magick wrote:
What about the direct conversion differs from that of first converting to JPEG?
Load both files with e.g. Inkscape. You can see that the image svg2gif2ppm displays the graph and the direct svg2ppm image appears as black rectangle where you can't see anything.
The viewer program doesn't matter, I also get the same bad result when I open the images within LyX that uses a different ppm rendering engine than Inkscape. In LyX the direct svg2ppm is also unreadable.
Posted: 2006-04-30T16:18:16-07:00
by magick
Most likely the other programs can only display 8-bit PPM files. Try adding -depth 8 to your command line to produce acceptable PPM image files.