Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
don't conflate SetImageColorspace and TransformImageColorspace #46
rmagick is conflating SetImageColorspace and TransformImageColorspace. This is the difference between "convert foo.png -set colorspace rgb ..." and "convert foo.png -colorspace rgb ..."
The former is like a reinterpret-cast in C++: it doesn't change the data, it just says the data is the given colorspace. The latter is a transform that changes the data based on the original image colorspace and the parameter.
I need SetImageColorspace and in the current code, it's not available if TransformImageColorspace is available.
This is a partial patch. I didn't wire in or test image.transform_colorspace(colorspace). If you're interested, I can ...
smparkes included the following code: https://github.com/rmagick/rmagick/pull/75/commits
Comment by bschwartz
image.colorspace = Magick::RGBColorspace
... it will trigger a colorspace transformation and mess up the colors of the image. Like the author of this patch, I'd expect that call to inform imagemagick that the image is RGB rather than transforming it to RGB.
This comment is related to this problem as well: b87199c