I want to convert RGB stereo pairs to gray anaglyph.
composite -stereo needs rgb images, so I need to convert color RGB to gray RGB. How?
Gray anaglyph
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Gray anaglyph
In IM 6, grayscale images should still work, since IM replicates the gray image 3 times. Internally to IM, grayscale images have 3 channels. But I do not know if -stereo will work properly on 3 equal grayscale channels, since I have not tested that. So go ahead and try it.
-
- Posts: 9
- Joined: 2015-11-21T11:45:38-07:00
- Authentication code: 1151
Re: Gray anaglyph
Thanks much. Yes,
composite -stereo 0 rgt.jpg -colorspace gray lft.jpg -colorspace gray anagg.jpg
works "like Magick".
composite -stereo 0 rgt.jpg -colorspace gray lft.jpg -colorspace gray anagg.jpg
works "like Magick".
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Gray anaglyph
If the images are already grayscale, then you do not need -colorspace gray. This should work in IM 6. It won't work in IM 7, since in IM 7 grayscale images are single channel. So you would have to -combine 3 copies of the grayscale image to format as RGB.
Code: Select all
composite -stereo 0 rgt.jpg lft.jpg anagg.jpg
-
- Posts: 9
- Joined: 2015-11-21T11:45:38-07:00
- Authentication code: 1151
Re: Gray anaglyph
The images are rgb to begin with. But gray anaglyph is usually better for checking stereo alignment.
-
- Posts: 9
- Joined: 2015-11-21T11:45:38-07:00
- Authentication code: 1151
Re: Gray anaglyph
Ideally, the -stereo operator should automatically convert a single channel image to 3 channel.