Re: How to create an anaglyph (stereo image) with modified depth
At the start of the channels section I say...lynx_abraxas wrote:One grey image for red and another for cyan/bg (because our "glasses" are red, cyan). I got to that command from the line in the channels examples (http://www.imagemagick.org/Usage/channels/#channels):As such, even if you use a "-channel BR" setting, "-combine" will expect two images, first the red then the blue. The green and alpha values will be set from the current "-background" setting values.
I suggest you do this as it would explain that images are stored either as RGB or CMY or CMYK (or some other data representation. You can not have a both a RED and a CYAN channel in the same image memory representation. Such as representation would be incomplete anyway.Before going any further I suggest you read about how IM actually saves images in memory by reading Image Storage Color System.
It goes on to explain that channel 'Cyan' or 'C' is actually a alias for the same data as 'Red' or 'R' channel. The meaning of that data depends on As such -channels RC is equivalent to -channels RR or just the Red channel. Thus only one channel, the red channel, will be extracted!!!!!
However CYAN is really just BOTH the combined GREEN and BLUE Channels, in the RGB colorspace. So all that is needed is to shift the red channel one way, and the blue and green channel the other way, together.
Now your input image is grayscale. so why not do this
Code: Select all
read image add pixels on right ( clone image roll image right ) ( clone last image ) combine the three images as RGB
and your have your base anaglyph for red-cyan glasses.
Code: Select all
convert gray_image.png \ -background black -gravity east -splice 5x0+0+0 \ \( +clone -roll +5+0 \) \ \( +clone \) \ -combine anaglyph.png