3D Tips, Tricks and Rigs / Discuss

Current Discussion

Canon EOS sync cable
Latest: 7 days ago
Viewing .jpg 3D images on a 3D television
Latest: 5 weeks ago
Here's my rig.
Latest: 4 months ago
Take 3D photo with a normal digital camera
Latest: 4 months ago
Anaglyph, Anachrome, "tight registration"
Latest: 15 months ago
New 3D Group
Latest: 18 months ago
How to make color 3d images in photoshop?
Latest: 26 months ago
RGB numbers for red/cyan, amber/blue, green/magenta?
Latest: 28 months ago
interested in learning more...
Latest: 34 months ago
My Stereo Camera Rig
Latest: 34 months ago
Making Anaglyphs in Gimp
Latest: 47 months ago
What is 3D photography?
Latest: 47 months ago
More...

Search this group's discussions

Making Anaglyphs in Gimp

view profile

stephpar is a group administrator stephpar  Pro User  says:

For those who don't know about the Gimp, it is an Open Source image manipulation program that is free and there are versions available for Windows, Linux, Mac OS X and probably other operating systems. It can be downloaded from http://www.gimp.org. Gimp deals with images using layers, like Photoshop, and is very powerful but doesn't handle RAW images. It is also expandable using scripts and plug-ins.

For those who aren't sure what anaglyphs are, they are those funny looking pictures with different coloured ghost images that when viewed with coloured glasses looks three dimensional. Check out Anaglyphic 3D group for some examples.

For those who want the easy method I have written a script that can be downloaded from the Gimp Plugin Registry. The script is called script-fu-make-anaglyph.

To install this script simply download it to your ../share/gimp/2.0/scripts folder (check the documentation that came with your version of the Gimp for where that is for your OS, this should be included in the help files). Then, when you next start Gimp it will have a menu item "Stereo/Make Anaglyph" on the menu bar or your image.

How to use the script. First open up the right-hand image in a new window. Then add the left-hand image as a new layer above the right-hand image. Then select "Make Anaglyph" from the "Stereo" menu on the image's menu bar. This will bring up a window where you can select which colours you want to use. If you want a standard Red/Cyan anaglyph just click on OK and the Gimp will then colour the two layers for you.

If you want to use different colours than Red/Cyan (or you want the Red for left-hand image, or you have put the left image at the bottom) then you will need to select the colours that you want to use. #Note# the colours need to be opposite to the colours of your glasses. For example, assuming that you have the right-hand image at the bottom, if you want to use red/blue glasses with the red lens on the right eye then you select Red for the top (left-hand) image and Blue for the bottom (right-hand) image.

I have not made the script merge down the layers so that you can move the layers to get best alignment for your shot. With anaglyphs vertical alignment needs to be exact and horizontal alignment adjusts the position of the "Plane of the paper" (this affects what appears in front of and behind the screen). After you are happy with the alignment simply choose "Merge Down" from the "Layer" menu and then save the image.

What the script does and how to do it yourself. The script first sets the foreground and background colours to the colours selected for the anaglyph (the foreground to the colour of the top layer and the background to the colour of the bottom layer). Then it selects the entire image and the top layer, using the bucket-full tool (settings: Mode: Screen; Opacity: 100%; Fill Type: FG color fill; Affected Area: Fill Whole Selection) it then colours the image for the top layer. Then, selecting the bottom layer, it colours the bottom layer using the same setting except that the Fill Type is now "BG color fill". The script then sets the mode of the top layer to Miltiply Mode so that both layers are visible as an anaglyph. The rest of the script just sets everything back to how it was at the start of the script and make the operation reversable (so that "Undo" works).

For those who want to use a different program the Screen mode used by the Bucket Fill tool "[...] inverts the values of each of the visible pixels in the two layers of the image. (That is, it subtracts each of them from 255.) Then it multiplies them together, divides by 255 and inverts this value again" (from the Gimp Documentation). This extracts the colour channel of the colour used (e.g. Filling with Red in Screen mode results in the Red channel being kept and the Blue and Green channels being set of 0).

The Multiply Mode used for the top layer "[...] multiplies the pixel values of the upper layer with those of the layer below it and then divides the result by 255" (from the Gimp Documentation). This simply combines the differently selected channels from the two images together.

Wyrd wes eower werad.
Steph.
Posted at 8:52PM, 11 July 2008 PDT (permalink)

Would you like to comment?

Sign up for a free account, or sign in (if you're already a member).

RSS 2.0 feedSubscribe to a feed of stuff on this page...</!!> Feed – Subscribe to 3D Tips, Tricks and Rigs discussion threads