Page 1 of 1

svg to png conversion and latex

Posted: 2013-02-18T13:07:43-07:00
by chicagocoyote
I just converted a .svg image to a .png with
the simple command:

convert file.svg file.png

This new png file displays fine in various image
display applications such as geeqie, eog (eye of gnome),
and ristretto.

However, when I read this .png into a latex document
this image does not display correctly and is mostly black.

Have people run into this before ?

I have never had an issue with a .png and latex before
and so I suspect that this is an issue with imagemagick
conversion.

Thanks.

Re: svg to png conversion and latex

Posted: 2013-02-18T13:41:10-07:00
by chicagocoyote
Ok, I just tried the -enhance flag, and the result did
create a .png that could be displayed correctly by
latex:

convert -enhance file.svg file.png

Re: svg to png conversion and latex

Posted: 2013-02-18T15:25:33-07:00
by fmw42
I do not see any connection between -enhance (a noise reduction filter) to your problem? Furthermore you would use -enhance after reading the input not before it. It is likely something with your SVG file and whether you have RSVG or IM SVG or some other SVG delegate installed. Though I am not an expert on SVG.

Re: svg to png conversion and latex

Posted: 2013-02-18T15:26:46-07:00
by glennrp
You should try to avoid a workflow that converts the SVG into a raster format and then imports it into LaTeX which is a vector format.
Try writing your original images as EPS and then importing that into LaTeX. See http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics
and other sites found by a google search for "svg latex", e.g., ftp://ftp.dante.de/tex-archive/info/svg ... FLaTeX.pdf

Re: svg to png conversion and latex

Posted: 2013-02-18T15:52:04-07:00
by chicagocoyote
My workflow includes creating images with gnuplot
and I ran into the bug that is documented here:

http://groups.google.com/group/comp.gra ... 79a36a3712

The bug exists with .png images but not .svg images.

Yes, I _should_ avoid this workflow, but right now,
"convert -enhance" to gnuplot created .svg images
is a work-able solution.