Magick++, image.read() greyscale image from buffer?
Posted: 2010-06-24T15:49:20-07:00
Hi,
I have an array of integers in memory, that I want to convert into a greyscale image. I'm trying to do this with image.read(), pointing it at the array as a buffer and giving it the appropriate width and height. The docs state that the "map_" argument to read() should be something like "RGB" or "CMYK" (or some re-ordering of these letters); but what should it be for greyscale images?
(I'm ultimately hoping to do 8-, 16- and 32-bit greyscale images this way. Fancy scientific imagery; long story. Not sure if the number of bits is relevant to this argument, though? I already specify it with "image.depth()".)
Adam
I have an array of integers in memory, that I want to convert into a greyscale image. I'm trying to do this with image.read(), pointing it at the array as a buffer and giving it the appropriate width and height. The docs state that the "map_" argument to read() should be something like "RGB" or "CMYK" (or some re-ordering of these letters); but what should it be for greyscale images?
(I'm ultimately hoping to do 8-, 16- and 32-bit greyscale images this way. Fancy scientific imagery; long story. Not sure if the number of bits is relevant to this argument, though? I already specify it with "image.depth()".)
Adam