Create test image:
Code: Select all
convert -size 100x100 xc:red xc:green1 xc:blue +append rgb.png
There is no "hue" in LAB colorspace. You need to use HCL, HSL, or HSV etc to affect the hue directly. But this does not give what you might expect and you will get different results from each of the H-based colorspaces. This is due to the fact that the hue is cyclical, so inverting the hue values is not the same as rotating by 180 degrees.
Code: Select all
convert rgb.png -colorspace HCL -channel R -negate +channel -colorspace sRGB rgb_invert1.png
In fact, HSV and HSL will just swap the green and blue channels.
Code: Select all
convert rgb.png -colorspace HSV -channel R -negate +channel -colorspace sRGB rgb_invert0.png
What I think you want is to rotate the hue by 180 (in -modulate hue would go from 100 to 0 or 200 to be equivalent to -+180 deg). This converts primary colors to secondary colors.
Code: Select all
convert rgb.png -modulate 100,100,0 rgb_invert2.png
But this is no different from:
Code: Select all
convert rgb.png -negate rgb_invert2.png
And is the same as adding 50% modulo to the hue channel
Code: Select all
convert rgb.png -colorspace HSV -channel r -evaluate AddModulus 50% +channel -colorspace sRGB rgb_invert4.png
You get a slightly different result by negating the A and B channels of LAB:
Code: Select all
convert rgb.png -colorspace LAB -channel GB -negate +channel -colorspace sRGB rgb_invert3.png
So it really depends upon what you mean by hue and which colorspace you work in.