ImageMagick "convert" utility equivalent to Magick ++?

Sorry if the name makes no sense.

Currently, the following imagemagick conversion utility options are perfect for what I need. I am trying to take a .svg file, make it larger and write it as a png file.

convert -density 36 home.svg home_1.png 

Unfortunately, I need to use Magick ++ (C ++ Interface / API for ImageMagick), but I cannot get the equivalent operation in Magick ++.

Are there any ImageMagick profiles that could help me with this?

My current code is:

 image.density(Geometry(36,36)); image.read( "Character.svg" ); image.write( "xx.png" ); 

I tried moving the image.density() , but my image never changes. It is just rasterized and saved as png.

+4
source share
1 answer

I am not ImageMagick pro, but when I tried this code:

 #include <Magick++.h> int main(int argc, char **argv) { Magick::Image img; img.density(Magick::Geometry(36,36)); img.read(argv[1]); img.write(argv[2]); img.density(Magick::Geometry(72,72)); img.read(argv[1]); img.write(argv[3]); } 

with this svg file for example:

 $ ./resize example.svg out_small.png out_large.png 

... out_small.png was 300x300 pixels, while out_large.png was 600x600 pixels.

This was on Windows 7 via cygwin.

+2
source

All Articles