I have a pointer to RGBA data, which i've read from openEXR file.
Code: Select all
// Rgba is a struct of halfs(openexr float type) r,g,b,a. (i.e sizeof(half) == sizeof(float))
Array2D<Rgba> pixels;
Magick::Image im(/*size*/);
im.magick("RGBA");
Magick::Blob blob(&pixels[0][0], (width * height) * sizeof(Rgba));
im.read(blob);
im.magick("JPEG");
im.write("outfile.jpeg");
Everything is ok, but the colors are grayed out and not properly clumped. OpenEXR data is float dynamic range values. ImageMagick - 16 bit.
My first approach was iterating through pixels array, remap values to 0 - 1 and using image.pixelColor() method to set modified values. It gives me proper pixel values, but is very slow, so i'm trying with Blob data.
Could you please tell me how can i remap values within ImageMagick. I see image.level() method, but it looks like after image.read(blob) all pixels values are already clumped.
This is what i get. I don't know why this is so washed out. It should be colored.