Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG not rendered correctly #193

Open
olcc opened this issue Jul 24, 2022 · 9 comments
Open

SVG not rendered correctly #193

olcc opened this issue Jul 24, 2022 · 9 comments

Comments

@olcc
Copy link

olcc commented Jul 24, 2022

ImageMagick version

6.9.11.60

Operating system

Linux

Operating system, version and so on

Debian testing

Description

The conversion of this SVG image to PNG shows errors:

  • The subscripts "1" and "2" are rendered too small.
  • The character R' in the original text is transformed to R\'.
  • The apostrophe in R' disappear in the chemical formula.
  • A big bar is added over the chemical formula.

You can view the original SVG image correctly in a browser or in Inkscape.

Steps to Reproduce

Just run: convert HEUR.svg HEUR.png

Images

HEUR
HEUR

@dlemstra dlemstra transferred this issue from ImageMagick/ImageMagick Jul 24, 2022
@fmw42
Copy link

fmw42 commented Jul 24, 2022

Imagemagick can use any of 3 SVG renderers: its internal MSVG/XML renderer, RSVG delegate and Inkscape in order of better quality. Load Inkscape on your system and Imagemagick should be able to find it and use it. I have used it to render in Imagemagick and it looks fine to me.

x

@olcc
Copy link
Author

olcc commented Jul 24, 2022

Thank you.
(1) Should the IM MSVG renderer be improved with respect to this example?
(2) Can you indicate your comand line for using inkscape from convert?

  • I do have Inkscape installed, but IM does not seem to use it.
  • I do have rsvg-convert installed and the rendering is good, but convert does not use it.
$ convert -list format | grep -i svg
MSVG  SVG       rw+   ImageMagick's own SVG internal renderer
 SVG  SVG       rw+   Scalable Vector Graphics (XML 2.9.4)
SVGZ  SVG       rw+   Compressed Scalable Vector Graphics (XML 2.9.4)

@fmw42
Copy link

fmw42 commented Jul 25, 2022

I just used

convert image.svg image.png
and that works if Inkscape is installed and IM can find it.

What do you get from

convert -version

Does it list RSVG? If not, then IM was not installed with that delegate even if you have it on your system. You would need to re-install after installing the RSVG delegate.

IM should be able to find Inkscape if both are in your $PATH environment variable.

Be sure with either RSVG or Inkscape to install the latest versions.

MSVG will not likely be improved (other than bugs), since RSVG and Inkscape are available and better (in my opinion)

@olcc
Copy link
Author

olcc commented Jul 25, 2022

Everything looks accessible from my $PATH:

$ convert -version
Version: ImageMagick 6.9.10-2 Q16 x86_64 20180618 https://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: https://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib

$ inkscape --version
Inkscape 1.1.2 (0a00cf5339, 2022-02-04)

$ rsvg-convert --version
rsvg-convert version 2.54.4

@fmw42
Copy link

fmw42 commented Jul 25, 2022

Be sure that Inkscape is in your $PATH as Imagemagick. RSVG may not be available because it was not installed with compilation of Imagemagick. If all else fails, upgrade to the current Imagemagick. Try upgrading Inkscape. I was using v 1.2. Yours is older at 1.1.2

According to the formats page:

ImageMagick utilizes inkscape if its in your execution path otherwise RSVG. If neither are available, ImageMagick reverts to its internal SVG renderer.

@olcc
Copy link
Author

olcc commented Jul 25, 2022

Be sure that Inkscape is in your $PATH

What does that mean exactly? I can run inkscape from the command line because /usr/bin is in my $PATH and the binary is /usr/bin/inkscape. Is there something more needed?

@fmw42
Copy link

fmw42 commented Jul 25, 2022

Is both Imagemagick and Inkscape in your $PATH environment variable. If so, the perhaps upgrade Inkscape and/or Imagemagick. The directories in which Imagemagick and Inkscape reside must be in your $PATH

@kleisauke
Copy link

ImageMagick utilizes inkscape if its in your execution path otherwise RSVG. If neither are available, ImageMagick reverts to its internal SVG renderer.

It looks like commit 58ad458 (released in version 6.9.12-59) makes the internal MSVG/XML renderer always no-op, so this comment is no longer correct.

AFAIK, the only way to utilize the internal MSVG/XML renderer is to remove the svg:decode delegate in delegates.xml. On Windows, you may also need to set the MAGICK_CONFIGURE_PATH environment variable.

@sergiomb2
Copy link

Hello , I also have a report about svg covert problem [1] seems related but I not sure , it suggest that version of SVG have impact over convert of ImageMagick

[1]
https://bugzilla.redhat.com/show_bug.cgi?id=2140018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants