ImageMagick / ImageMagick6

🧙‍♂️ ImageMagick 6
https://legacy.imagemagick.org
Other
199 stars 82 forks source link

SVG not rendered correctly #193

Closed olcc closed 1 month ago

olcc commented 2 years ago

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:

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

fmw42 commented 2 years ago

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 commented 2 years ago

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?

$ 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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 https://github.com/ImageMagick/ImageMagick6/commit/58ad45805c9c59eb80b85716eb0ba02f14b43c29 (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 commented 1 year ago

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

dlemstra commented 1 month ago

Using MSVG: can be used to force the MSVG coder.

olcc commented 1 month ago

I confirm that with my current version, the convertion convert HEUR.svg HEUR.png produces a good image.

$ convert -version
Version: ImageMagick 6.9.12-98 Q16 x86_64 18038 https://legacy.imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5) 
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png raw tiff webp wmf x xml zlib