Page 1 of 1
'Reverse' Anaglyph [solved]
Posted: 2017-06-23T22:33:19-07:00
by cantilever
Hi All -
I've used the following code to try and produce a red/cyan anaglyph:
composite <filepath> -stereo +20+0 <filepath> anaglyph.jpg
magick convert <filepath> -channel r -separate -roll +20+0 ( +channel <filepath> -separate -delete -3 ) +channel -combine anaglyph.jpg
Both work - but both create an image that has the red channel as the dominate image with the cyan channel as a transparent ghost shifted. I'd like to reverse this where the cyan channel is the dominate image with the red channel ghosting it.
Thoughts?
Re: 'Reverse' Anaglyph
Posted: 2017-06-23T23:18:21-07:00
by fmw42
I understand a bit about anaglyph, but what determines which image is dominant. Are you taking about left right eye or something else?
Have you tried -roll -20+0? Is that what you want?
Or add +insert before the combine?
Please always provide your IM version and platform and example images, if possible.
Re: 'Reverse' Anaglyph
Posted: 2017-06-23T23:30:26-07:00
by cantilever
ImageMagick-7.0.6-0-Q16-x64 - Windows 10
The -roll as it concerns these two scripts always repositions the cyan overlay. A better description would be as follows: the dominate/red image looks like the contents of the photo with the red channel overlaid whereas the cyan overlay looks transparent at about 10%. I'd like to reverse this and show the image contents with the cyan overlay and a ghosted transparent red channel.
The image attached shows this dominant red vs transparent cyan issue.
*image removed.
Re: 'Reverse' Anaglyph
Posted: 2017-06-23T23:36:35-07:00
by fmw42
This works for me. I am not sure which way you want it. But cyan is a secondary color and thus is appears lighter than the red primary color. So I think your eyes will alway want to see red over cyan.
Code: Select all
convert input.jpg \
\( -clone 0 -channel r -separate -roll +20+0 +channel \) \
\( -clone 0 -channel gb -separate +channel \) \
-delete 0 \
-combine result2.jpg
Code: Select all
convert input.jpg \
\( -clone 0 -channel r -separate -roll -20+0 +channel \) \
\( -clone 0 -channel gb -separate +channel \) \
-delete 0 \
-combine result2.png
Re: 'Reverse' Anaglyph
Posted: 2017-06-23T23:48:52-07:00
by cantilever
Thanks for the quick response.
The -roll seems to shift only the cyan transparency to the left or right, which isn't exactly what I'm looking for. I'm not concerned with which direction or order the colors are in at the moment, moreso, I want to see the main image with a green/cyan overtone and let the red 'float'. Is there any way to show the anaglyph with, if not a dominate color, at least an equal green/cyan and red transparency?
*image removed.
Re: 'Reverse' Anaglyph
Posted: 2017-06-24T00:06:52-07:00
by cantilever
It's most likely an issue with the background coloring and not the organization/transparency of the channels. I think I will revisit this with a darker photography backdrop...
Re: 'Reverse' Anaglyph
Posted: 2017-06-24T10:13:25-07:00
by cantilever
Looks like the background color was the culprit - thanks for walking through the process!
Re: 'Reverse' Anaglyph
Posted: 2017-06-24T10:36:14-07:00
by fmw42
I have moved this post to the Users forum, since it is about the use of ImageMagick and not esoteric image processing.