Antialias and density not working for svg files

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
OstCollector
Posts: 1
Joined: 2014-09-14T09:24:38-07:00
Authentication code: 6789

Antialias and density not working for svg files

Post by OstCollector »

I'm trying to convert some SVG files to PNG.
And found -density option not working.

command line following viewtopic.php?f=1&t=11168

Original SVG:
http://realtimeweather.info/numerical/gfs/svg.svg

Convert to PNG with 144dpi:

Code: Select all

convert +antialias -density 144 svg.svg 144.png
http://realtimeweather.info/numerical/gfs/144.png

Convert to PNG with 288dpi:

Code: Select all

convert +antialias -density 288 svg.svg 288.png
http://realtimeweather.info/numerical/gfs/288.png


OS: Gentoo Linux

The imagemagick version is 6.8.9.7, build by portage
configured with:

Code: Select all

./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --disable-silent-rules --disable-dependency-tracking --disable-static --disable-hdri --disable-opencl --with-threads --with-modules --with-quantum-depth=16 --with-magick-plus-plus --without-perl --with-perl-options=INSTALLDIRS=vendor --with-gs-font-dir=/usr/share/fonts/urw-fonts --with-bzlib --without-x --with-zlib --without-autotrace --with-dps --without-djvu --with-dejavu-font-dir=/usr/share/fonts/dejavu --without-fftw --without-fpx --without-fontconfig --with-freetype --with-gslib --without-gvc --without-jbig --with-jpeg --with-openjp2 --without-lcms --without-lcms2 --without-lqr --without-lzma --without-openexr --without-pango --with-png --with-rsvg --with-tiff --without-webp --without-windows-font-dir --without-wmf --without-xml --disable-openmp
The librsvg version is 2.40.2, build by portage
configured with

Code: Select all

/var/tmp/portage/gnome-base/librsvg-2.40.2-r1/work/librsvg-2.40.2/configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --disable-silent-rules --disable-dependency-tracking --docdir=/usr/share/doc/librsvg-2.40.2-r1 --disable-maintainer-mode --disable-gtk-doc --disable-static --disable-tools --disable-introspection --without-gtk3 --disable-vala --enable-pixbuf-loader
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Antialias and density not working for svg files

Post by snibgo »

Rule of thumb: if RSVG doesn't do what you want, try Inkscape.

Density works fine with your SVG, when Inkscape is the delegate.
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: Antialias and density not working for svg files

Post by fmw42 »

In general, -density has worked fine for me with RSVG. I am not sure antialiasing is an viable argument with SVG files. If it is, it probably needs to be put after the input file, whereas -density needs to be before the file.
Post Reply