Code: Select all
Magick::Image image; image.type(Magick::TrueColorMatteType); image.read(Magick::Geometry(width, height), filename); auto packet=image.getConstPixels(0, 0, width, height);
Well, more or less. A second, minor problem, is that ImageMagick is convinced that the SVG file's dimensions are 40x40:
$ identify images/default/checkbox1.svg
images/default/checkbox1.svg SVG 40x40 40x40+0+0 16-bit sRGB 1.22KB 0.000u 0:00.009
In Inkscape, this was created as a 32x32 image, and other tools, such as eog, correctly report it as a 32x32 image (and eog correctly displays the image with its transparent background).