Pre-processing options to cycle the hues, or alter the saturation or brightness of images to enhance the overall 3D effect even further.
At the time, I simply wanted a program to batch convert sets of stereo images into an animation. I couldn't find one, so I created my own. Along the way, I became more interested in how the 3D effect is achieved, and found that the problem of ghosting could be greatly reduced by altering the gamma of the red component in the final stereo image. This along with the above mentioned features, and further development of the program prompted me to release Stereoptica on the web for anyone to use. Hope you find it useful!
The program can easily be run from the command line by typing for example:
stereoptica l=leftpic.gif r=rightpic.gif
Stereoptica can load and save PNG, JPG, GIF or BMP images. The saved files will be under the name of "stereo_out", and can be found in the directory that the command line is currently in.
It is advised you read and experiment with some of the options below to maximize the 3D effect of your final creation. In particular, the options "swap", "trimout=..." and "trimin=..." can greatly affect the quality of the output.
For those who rarely use the command line: To make things easier, copy any pictures to the same directory as Stereoptica, and then "cd" to that directory path where the program is located by typing:
(or whereever Stereoptica is located).
Now it should be trivial to use the program and its features.
(replace *** stars with number or name)
help See this options list in the command line
l=*** Replace *** with filename of left pic. E.g.: l=myleftpic.gif
r=*** Replace *** with filename of your right picture
save=*** Enter gif, png, jpg, or bmp for save format (default = png)
col256 Convert from true colour to 256 colours before saving
stereo Add this parameter for a stereogram instead of an anaglyph
swap Swaps the left and right pictures (easy fix for bad looking 3D)
trimout=*** Measure in pixels. Crops the outside of pictures (default = 0)
trimin=*** Measure in pixels. Try trimout before this (default = 0)
batch Batch process multiple images.
frames=*** No. of frames to process if batch is selected (default=0 (all))
Further global settings - Pre-processing of images:
hue=*** Enter from 0 to 6. Cycle hues round colour wheel (default = 0)
reversehues This addition reverses the hues, so RGB becomes BGR
chroma=*** Enter from 0 onwards. Adjust chroma of images (default = 1)
bright=*** Enter from 0 onwards. Adjust brightness of images (default = 1)
Anaglyph settings (ie. if 'stereo' isn't added as a variable):
monochrome Removes colour from the anaglyph, but may have slightly nicer 3D
red=*** Adjust red element. Typical values range from 1-3 (default = 1.4)
noenhance Disable the 3D enhancing colour processing to remove ghosting
evar1=*** Experimental variable 1 for 'enhance' processing (default = 1.2)
evar2=*** Experimental variable 2 for 'enhance' processing (default = 0.2)
Stereo settings (ie. if 'stereo' is added as a variable):
gap=*** The gap (in pixels) between the left and right images
gapr=*** Set the R gap colour from 0-255 (default=0)
gapg=*** Set the G gap colour from 0-255 (default=0)
gapb=*** Set the B gap colour from 0-255 (default=0)
stereoptica l=leftpic.gif r=rightpic.gif
stereoptica l=lpic.png r=rpic.png stereo batch trimout=20 bright=1.5
Save out in either png, bmp, gif, or jpg. Preferably in that order. Try not to ever use jpegs for anaglyph images, as the artifacts (even at highest quality jpegs) spoil the effect. Even gif in 256 is preferable, especially with the amazing 256c quantize function courtesy of
With this paramater added to the command line, a stereogram rather than an anaglyph will be produced.
Compare the difference between these two images:
With the stereogram, you need to cross your eyes inwards to see the 3D effect, while with the right pictures, you need 3D glasses. With stereograms, there is also the option of crossing your eyes in parallel to see beyond the screen instead of in front. Stereoptica has support for this (just use the 'swap' option!)
Here are some advantages and disadvantages of both methods.
You don't need 3D glasses to view the effect
They can remain in full colour
They require skill at crossing your eyes to see properly
Because double the width is required for the two picture, a full-screen picture will only appear at half size.
There are two distracting images to the left and right of the third central stereo image.
The can be viewed at full screen size
They are easier to see than stereograms for the novice
The viewer is required to have 3D glasses (red/green or red/cyan)
The effects of colour pollution through the spec filters can produce less than perfect results.
Option: trimout=... (or trimin=...)
With either of these paramaters added to the command line, Stereoptica will crop (in number of pixels) the left or right of the images to remove portions of the image which don't contribute to the 3D effect. As as important side effect, in anaglyph mode (non-stereogram), it will also move the depth of the image into or out of the screen. This is something which can improve the appearance of the 3D effect (ideally, you often want the 3D depth to start at the screen depth and go into the screen).
To demonstrate the advantageous effects of trimming, compare these two images with some anaglyph specs:
The cropped version, although smaller, looks more effective, because the depth of field starts at the screen, and goes 'inside' it. Look at the dark beams at the top for example. They look neatly attached to the picture border in the cropped version, and look disjointed in the uncropped version. Also, glance at the left of the picture. In the uncropped version, the red part doesn't have its complementary cyan equivalent (close your left, and right eye alternately to see the left part of the picture added to the left/red view - missing in the right/cyan view).
To achieve the best look for anaglyph mode, experiment first with the trimout parameter (sometimes trimin may need to be used). Try and make sure that the front objects are at the same position in both the left and right pictures to achieve best results. For example, look at the road marks in the cropped version - they 'join up' nicely.
In stereogram mode (option: stereo), don't worry about the the above paragraph, and instead just try to make sure there aren't extra portions of screen area on the left and right side of each image, otherwise, these areas will appear strange in the stereogram.
With this parameter included, you will be able to process multiple frames in one go - useful for creating animations. You only need to specify the first left and right pictures as usual, and Stereoptica will automatically look for successive frames. It does this very intelligently by isolating the number in the file/filepath name, and incrementing this by one. For example: