Page 1 of 1

Animated Anaglyph

Posted: 2017-06-24T10:18:57-07:00
by cantilever
- ImageMagick-7.0.6-0-Q16-x64 - Windows 10

What is the best way to process an animated gif to produce a 3d anaglyph? My current multi-step process works but I think it may have redundancies / processor-intensive. I'm looking to simplify the code if possible:

1. magick convert "filepath[0-2]" -sigmoidal-contrast 10,25% -coalesce filename.png
(description - above line of code splits .gif into frames, processes each frame and saves into separate folder as .png file)

2. magick convert filename-0.png -channel r -separate -roll +20+0 ( +channel filename-0.png -separate -delete -3 ) +channel -combine filename-0.png
(description - above line of code processes first frame into anaglyph and overwrites itself)

3. magick convert filename-1.png -channel r -separate -roll +20+0 ( +channel filename-1.png -separate -delete -3 ) +channel -combine filename-0.png
(description - above line of code processes second frame into anaglyph and overwrites itself)

4. magick convert filename-2.png -channel r -separate -roll +20+0 ( +channel filename-2.png -separate -delete -3 ) +channel -combine filename-0.png
(description - above line of code processes third frame into anaglyph and overwrites itself)

5. magick convert -delay 15 filename-0.png filename-1.png filename-2.png filename-1.png -loop 0 filename.gif
(description - above line of code reassembles frames 0,1,2,1 into a looping boomerang animation with a 15/100 sec timing and saves as .gif)

Haha, there's gotta be an easier way!

Is it possible to use either the above code or the 'composite <filepath> -stereo +x+y' code to process each frame without separating the gif and then reassemble back into an animation?

Re: Animated Anaglyph

Posted: 2017-06-24T10:36:26-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.