The HueCompositeOp operator does not work as described/expected.
From the description, it is supposed to copy the hue from one image to another.
From the description of the "Hue" blendmode in photoshop, that's what this does, too.
But the actual result seems to be more like a blend of the two hues - I'm not sure what this operator does, but the hue of the resulting image is nothing like the hue of neither the source or destination image, it appears to be some sort of blend of the two hues.
So, for example, if "a.png" is solid red (#ff0000) and "b.png" is solid green (#00ff00), combining with the "Hue" blend mode in Photoshop gives you a brighter red (#ff6a6a), but with the exact hue of "a.png", as it should be.
Combining the images with IM, on the other hand, results in a solid yellow (#ffff00) - which does not resemble the hue of any of the source images.
Clearly this is wrong?
Here's my sample script:
Code: Select all
require 'rubygems'
require 'RMagick'
include Magick
a = Image.read('a.png').first
b = Image.read('b.png').first
a.alpha = ActivateAlphaChannel
b.alpha = ActivateAlphaChannel
a.composite(b, 0, 0, HueCompositeOp).write('test.png')