don't conflate SetImageColorspace and TransformImageColorspace #46

Open
bf4 opened this Issue Jul 24, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@bf4
Member

bf4 commented Jul 24, 2014

Issue by smparkes
Sunday Apr 21, 2013 at 23:04 GMT
Originally opened as #75


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

@bf4

This comment has been minimized.

Show comment Hide comment
@bf4

bf4 Jul 24, 2014

Member

Comment by bschwartz
Wednesday Mar 26, 2014 at 02:14 GMT


👍 to this. We've been bitten by this problem several times. Without this patch, if you do something like this:

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

Member

bf4 commented Jul 24, 2014

Comment by bschwartz
Wednesday Mar 26, 2014 at 02:14 GMT


👍 to this. We've been bitten by this problem several times. Without this patch, if you do something like this:

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

@bf4

This comment has been minimized.

Show comment Hide comment
@bf4

bf4 Jul 24, 2014

Member

Comment by freerobby
Wednesday Mar 26, 2014 at 02:54 GMT


👍 Please pull this in! Thank you @smparkes for the fix.

Member

bf4 commented Jul 24, 2014

Comment by freerobby
Wednesday Mar 26, 2014 at 02:54 GMT


👍 Please pull this in! Thank you @smparkes for the fix.

@bf4

This comment has been minimized.

Show comment Hide comment
@bf4

bf4 Jul 24, 2014

Member

Comment by jamesfzhang
Wednesday Mar 26, 2014 at 13:30 GMT


👍

Member

bf4 commented Jul 24, 2014

Comment by jamesfzhang
Wednesday Mar 26, 2014 at 13:30 GMT


👍

@linduxed

This comment has been minimized.

Show comment Hide comment
@linduxed

linduxed Dec 6, 2015

Original PR here: rmagick-temp#75

linduxed commented Dec 6, 2015

Original PR here: rmagick-temp#75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment