Stereoptica Help - Convert two 2D images to 3D

Go to main download page
  • Purpose
  • Background
  • Install
  • Uninstall
  • Quick-start
  • Further details
  • Legal stuff

    Purpose

    This software converts two 2D images/photographs, and creates colour or monochrome 3D anaglyphs and stereograms. Compared to most programs of this type, Stereoptica has a unique variety of features including:

  • Monochrome, colour, stereogram, or anaglyph pictures supported via PNG, BMP, JPG or GIF.
  • The ability to batch process multiple images for animation.
  • A special experimental feature to enhance the anaglyph effect to reduce 'ghosting' (see later).
  • Ability to trim the outside or inside of images to enhance the 3D effect further.
  • Pre-processing options to cycle the hues, or alter the saturation or brightness of images to enhance the overall 3D effect even further.

    Background

    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!

    Installation

  • Windows users: The program is very easy to install and use. Simply extract the ZIP file contents, and run the "StereopticaGUI" file.
  • Linux users: You'll need to download the source from http://freeimage.sourceforge.net/ to be able to compile. The only source file needed from Stereoptica's point of view is stereoptica.cpp, which is included. Unlike the Windows version, program usage is currently through the shell only (but still very easy to use, for example try: stereoptica l=leftpic.gif r=rightpic.gif).

    Uninstall

    Simply delete the Stereoptica folder. No other files are saved anywhere else.

    Quick-start

    This help file is for the Windows GUI version (Linux users should visit this page).

    Usage is pretty self-explanatory. Click the "Open..." buttons for the left and right pictures, and then click "Preview" to create the anaglyph/stereo version below. Select either "Stereogram" or "Anaglyph" as your 3D output type, and then click "Preview" again to update the composition image. If you want Stereoptica to automatically update the image every time you change a setting, click "Realtime rendering" (though speed can sometimes slow down if you do this, so be aware of this with super-large images).

    When you want to Save your final composition, click "Save" and select a location of your choice. Stereoptica can load and save PNG, JPG, GIF or BMP images. For detailed descriptions of all the options see below.

    Documentation

    For the help below, click each hyperlink to obtain further info (everything is all in this one HTML page).

    MAIN BUTTONS:
    Open...        You'll need to click this first of all to select the left and right images.
    <-> button     Swaps the left and right pictures (easy fix for bad looking 3D)
    Preview        Click this to see how the final output image will look.
    Save           Save final composition image/s to a location of your choice.
    Help           Clicking this will view this HTML page.
    Buy Now        Pay a donation of your choice ($5-$15 recommended) to get rid of the Stereoptica watermark on the output images.
    
    
    3D TYPE:
    Stereo/Anaglyph         Select between these two for a stereogram or anaglyph composition type
    (anaglyph requires red/green/blue glasses, while stereogram mode requires crossing your eyes).
    
    
    Anaglyph settings (ie. when Anaglyph 3D type is selected):
    Monochrome           Removes colour from the anaglyph, but may have slightly nicer 3D
    Adjust red           Adjust red element. Typical values range from 1-3 (default = 1.4)
    Disable 3D enhance   Disable the 3D enhancing colour processing to remove ghosting
    Adjust A             Experimental variable 1 for 'enhance' processing (default = 1.2)
    Adjust B             Experimental variable 2 for 'enhance' processing (default = 0.2)
    
    Stereogram settings (ie. when Stereogram 3D type is selected) :
    Gap between L and R    The gap (in pixels) between the left and right images
    Red color gap          Set the R gap colour from 0-255 (default=0)
    Green color gap        Set the G gap colour from 0-255 (default=0)
    Blue color gap         Set the B gap colour from 0-255 (default=0)
    
    OUTPUT OPTIONS
    Format                      Select between gif, jpg, png or bmp format for the output image.
    Convert to 256 colours      Convert from true colour to 256 colours before saving
    Trim outside                Measure in pixels. Crops the outside of pictures (default = 0)
    Trim inside                 Measure in pixels. Try trimout before this (default = 0)
    Batch process               Batch process multiple images.
    Frames	                    No. of frames to process if batch is selected (default=0 (all))
    
    IMAGE OPTIONS:
    Cycle hues      Enter from 0 to 6. Cycle hues round colour wheel (default = 0)
    Reverse hues    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)
    



    Further details

    Save

    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 colour mode is often preferable, especially with the amazing 256c quantize function courtesy of the NeuQuant neural-net quantization algorithm by Anthony Dekker.

    Stereogram/Anaglyph

    Compare the difference between these two images:

    Stereogram

    Anaglyph
    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.

    Stereogram
    Advantages
  • You don't need 3D glasses to view the effect
  • They can remain in full colour

    Disadvantages
  • 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.

  • Anaglyph
    Advantages
  • The can be viewed at full screen size
  • They are easier to see than stereograms for the novice

    Disadvantages
  • 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.

  • Trim inside/outside

    Stereoptica can 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:

    Uncropped

    Cropped
    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 Trim Outside setting (sometimes Trim Inside 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, 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.

    Batch

    You can 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:

  • left001.png will go to left002.png
  • left002.png will go to left003.png
  • 1right.gif will go to 2right.gif
  • my00037file.jpg will go to my00038file.jpg
  • c:\stuff\left20.bmp will go to c:\stuff\left21.bmp etc. etc.

    Use in conjunction with the number of frames if you like, but if not specified, Stereoptica will automatically look for all possible frames.

    Frames

    Use in conjunction with Batch. Basically, if you specify this, Stereoptica will do x amount of frames instead of all of them.

    Hue

    This neat parameter cycles the hue of the images. Entering a positive number will shift the hues, such that red will become yellow, yellow become green, green become cyan etc.. Possible values are from 0 (default, no change) to 6. In fact 0 = 6, because the function is modulus 6. Compare:

    Original

    Hue shifted by 2/6
    Use this feature in conjunction with Reverse Hues to alter and possibly enhance the final 3D image.

    Monochrome

    Used for anaglyph mode. Less colour, and generally not as good, though arguably more appropriate for red/green glasses type instead of the red/cyan type. Compare:

    Full colour

    Monochrome
    Use this feature in conjunction with Reverse Hues to alter and possibly enhance the final 3D image.

    Adjust red

    Sensible values for this parameter range from 1 to 2 (default=1.4). Because the cyan colour on LCD screens (less so on cathode ray tubes) emits red pollution, it's advisable to increase the red component to partially camouflage any possible ghosting. Once everyone uses the upcoming OLED screen technology, we can drop this feature and just stick with red=1 (no processing).

    It's less noticable in this example, but if you look at the bright edge at the right side of the road, the "normal" image has some ghosting just to the right of that (over the dark blue space).

    Extra red to reduce ghosting

    Normal

    Disable 3D enhance

    This option turns off one of the nicest features of Stereoptica. Basically, the amount of ghosting is drastically reduced as a result of gamma correction of the red component based on the brightness of the green component. Compare these two images with red/cyan or red/green specs:

    Enhance

    No Enhance (no processing)


    Enhance

    No Enhance (no processing)

    As you can see, the 'enhance' versions have less ghosting (albeit slightly darker). As explained earlier, the problem stems from the fact that monitors and TVs don't display proper cyan, but instead have some red pollution coming through (see the "Eclipse of Mars" illusion at www.skytopia.com for a dramatic demonstration of this). This issue should be alleviated once OLED displays become commonplace, and then maybe you can turn noenhance on!

    Adjust A and B are experimental variables for the enhanced mode. They are 1.2 and 0.2 respectively as default.

    Gap between L and R

    The pixel gap between L and R modes. In stereogram mode, this inserts a gap between the two pictures. The gap can be any colour, depending on the Red/Green/Blue color gap parameters. Compare:


    Normal

    With dark blue gap

    Legal stuff

    Copyright (c) 2007, Daniel White, Skytopia.com
    All rights reserved.

    Results (rendered pictures) produced from the program (the binary/exe) may be freely used providing:
    1: No more than five frames (pictures) are used for commercial purposes, without my express permission. Anyone wishing to do more than five in total may wish to do so for a reasonable fee by contacting me from:
    http://www.skytopia.com/email.html

    Furthermore, you may modify the source for your own use (the above clause still applies), but redistribution of the modified source is not allowed without my permission. However, you may use up to 50 lines of code (except the exact code in the "POST PROCESSING" section), or any of the function code in your own projects freely.

    Redistribution of the unmodified program is permitted, providing:
    1: The software is not sold or used for commercial purposes, without my express permission
    2: All of the files are kept together and intact.

    THIS SOFTWARE IS PROVIDED BY DANIEL WHITE "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DANIEL WHITE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    ************************************************************************************

    This software uses the (excellent) FreeImage open source image library.
    See http://freeimage.sourceforge.net for details.

    FreeImage is used under the FIPL, version 1.0.

    *************************************************************************************

    Through FreeImage, this software also uses the amazing NeuQuant neural-net
    quantization algorithm by Anthony Dekker for converting 24 bit images to 8 bit.