magick-rust icon indicating copy to clipboard operation
magick-rust copied to clipboard

Create MagickWand and fill with raw RGBA

Open Jacherr opened this issue 3 years ago • 2 comments

Might be an easily answered question if I looked harder, but is it possible to take a raw RGBA buffer and pass it to ImageMagick using this crate?

I imagine it will be some mixture of read_image_blob, but I need some way to tell ImageMagick the dimensions of the image. Am I on the right track, or is this not possible at the moment?

Jacherr avatar Jun 08 '22 19:06 Jacherr

I don't know enough about ImageMagick to know, hopefully someone else can chime in.

nlfiedler avatar Jun 10 '22 17:06 nlfiedler

This is possible using MagickWand::import_image_pixels method (https://imagemagick.org/api/magick-image.php#MagickImportImagePixels). See this PR https://github.com/nlfiedler/magick-rust/pull/99, which improves the existing API and adds a unit test that demonstrates how to use it.

jshrake avatar Feb 06 '23 04:02 jshrake