Nav:  [home][ani][utils] > [anaglyphjoin]
 

AnaglyphJoin -- Creating Anaglyphs

Description

AnaglyphJoin lets you compose anaglyphs from left-right image pairs. You can see examples created using this program on my anaglyph page.

Fetures:

  • Operates on PNG images, only. (Grayscale and RGB, 8 or 16 bit per channel.)
  • For standard grayscale anaglyphs, it performs on-the-fly grayscale conversion with tunable color weights and optional gamma correction.
  • Support for colored anaglyphs (probably only useful for red/cyan glasses)
  • Support for any channel color, including most common red/cyan, red/blue and red/green.
  • Optional graphical display during converion.
  • Can process any number of frames to convert complete films.

Download and Build

AnaglyphJoin is only available as source code; you need to compile it yourself. This is not trivial because AnaglyphJoin depends on HLib (for the PNG image IO) and QTXLib (for the graphical output using X11). However, people with a Linux box and familiar to compiling GNU source packages should not have any problems. However, note the list of requirements.

Source: anaglyph-join.cc   [21kb C++ source]
Version:0.8   (2004-05-22)
Author:Wolfgang Wieser   (report bugs here)
License:GNU GPL (Version 2)
Requires:HLib>=1.0.0, QTXlib, libpng, libz, Qt-3, X11 headers

Requirements:
As for builing requirements, check HLib and QTXlib instructions. Once you built both these libraries (preferrably using GCC>3.0), compile anaglyph-join.cc using somethimg like:

bash# ln -s /path/to/hlib-build/include/hlib hlib
bash# ln -s /path/to/qtxlib/src QTX
bash# ln -s /path/to/qt/include Qt
bash# ls -l
lrwxrwxrwx  ...  QTX -> /home/xx/yy/qtxlib/src/
lrwxrwxrwx  ...  Qt -> /opt/Qt/include/
-rw-r--r--  ...  anaglyph-join.cc
lrwxrwxrwx  ...  hlib -> /home/xx/yy/hlib-build/include/hlib/
bash# gcc -O2 anaglyph-join.cc -o anaglyph-join -I. \
  -fno-rtti -fno-exceptions -funroll-loops -ffast-math -finline-functions \
  -march=athlon-xp -mmmx -msse -m3dnow -mfpmath=sse \
  -lqt-mt -L/path/to/qt/lib /path/to/libqtxlib.a /path/to/libhlib.a \
  -lpng -lz -lm

Of course, you need to substitute appropriate paths and feel free to use different optimization flags. The ones above were experimentally verified to be much better than plain -O2 on an AthlonXP but you should substitute your architecture, of course.

Bugs:
AnaglyphJoin should work with equally-sized left/right image pairs in PNG format, either grayscale or RGB with 8 or 16 bit color depth per channel. In case you find a bug in AnaglyphJoin, do not hesitate to report it to the author.

AnaglyphJoin Manual

Maybe I will add a more detailed description on AnaglyphJoin's command line arguments here. For now, use option --help for a quick reference:

bash# ./anaglyph-join --help
** This is anaglyph-join version 0.8 **

Standard query options:
  --version: print version string
  --author:  print author (and bug report info)
  --license: print license
  --help:    print this help
  --section-help: print help for specified section only
Available parameters:
  -n (parameter): number of frames to convert [leave away for auto detect]
  -f0 (parameter): frame number to start with [0]
  -j (parameter): process every j-th frame [1]
  -z (parameter): output PNG file compression level (0-9) [6]
  -f (parameter): output frame file name pattern; may contain %d/%x-spec for
      frame number [o%07d.png]
  -c|color (switch): preserve color in anaglyph (useful for red-cyan) [no]
  -gw (parameter): weights for grayscale conversion of RGB input; sum should be
      1 [0.3,0.59,0.11]
  -bg (parameter): background color to add to output image [#000000]
  -x|dpy (switch): display images being processed [no]
  -wait (switch): wait for key press between frames (implies -dpy) [no]
  -l (section): left eye side
    Parameters in section `lī
    -f (parameter): frame file pattern; may contain %d/%x-spec for frame number
        [l%07d.png]
    -c (parameter): primary color of left side (color of glasses) [#ff0000]
    -ggma (parameter): gray channel gamma value for gamma correction (only if
        color is not preserved) [1]
  -r (section): right eye side
    Parameters in section `rī
    -f (parameter): frame file pattern; may contain %d/%x-spec for frame number
        [r%07d.png]
    -c (parameter): primary color of right side (color of glasses) [#00ffff]
    -ggma (parameter): gray channel gamma value for gamma correction (only if
        color is not preserved) [1]

All colors may be specified as hex triplett (#rrggbb) or as three floats in
range 0..1 separated by commas.

Defaults are set up for red-cyan glasses; example: anaglyph-join -x -c

[home] [site map] [Impressum] [Datenschutz/privacy policy]
Valid HTML 4.01!
Copyright © 2004-2007 by Wolfgang Wieser
Last modified: 2007-02-09 00:33:00