magick++ colorspace confusion
Posted: 2010-02-18T19:11:47-07:00
I'm using image magick to read and write images and my own internal format for actual processing. Recently my images have come from different colorspaces (log, rec709, sRGB, and linear). I'd like to read in the file and then convert it into a linear space to be worked on. ImageMagick seems to have support for this but I haven't been able to make it work as I'd expect.
example : I want to tell image magick the file colorspace is sRGB so I get a good RGB back.
What I get out of the blob is a "brighter" image than if I do not call SetImageColorspace, but I expected "darker". Obviously I'm new to working with colorspaces so I might have a significant misunderstanding of some concepts.
I am also trying to play with these functions to figure this out. Any help on where and when to use these would also be greatly appreciated.
example : I want to tell image magick the file colorspace is sRGB so I get a good RGB back.
Code: Select all
Magick::Image img;
img.read( filename );
img.magick( "RGB" );
MagickCore::SetImageColorspace( img.image(), MagickCore::sRGBColorspace );
Magick::Blob blob;
img.write( &blob );
I am also trying to play with these functions to figure this out. Any help on where and when to use these would also be greatly appreciated.
Code: Select all
Magick::Image img;
img.colorSpace( MagickCore::ColorspaceType );
img.colorSpaceType( MagickCore::ColorspaceType );
MagickCore::RGBTransformImage( img.image(), MagickCore::sRGBColorspace );
MagickCore::SetImageColorspace( img.image(), MagickCore::RGBColorspace );
MagickCore::TransformColorspace( img.image(), MagickCore::sRGBColorspace );
MagickCore::TransformRGBImage( img.image(), MagickCore::Rec709LumaColorspace );