You are here: Home / Journal / 3D stereograms

3D stereograms

These are some almost SooC images BUT with left and right images swapped AND “alignment circles” at the bottom. They were captured with my recently constructed stereo camera module. This is part of an ongoing project to create a modular GNU/Linux digital camera system using easily available generic components. 

Although the images themselves are unedited, the left and right images have been swapped over, using a simple BASH shell script (detailed below). Thus they behave as 3d cross-eyed pairs. To view them in 3D simply cross your eyes slightly until a third image appears between the two photos. This version of these images also has “alignment circles” at the bottom of the images to help the viewer align his/her eyes correctly. If you are doing it correctly then this third image will be in 3D. The silver-coloured mannequin and model Estella Rose will clearly be in the foreground.

Gallery of cross eyed stereo pairs c/w alignment circles

Script

#!/bin/bash

# garf-crosseeyed+bg
# 
# By Garfleld Lucas.
# Updated 2026-05-19.
#
# Converts parallel stereo pairs into cross-eyed stereo pairs
# by swapping the left and right halves.
# This version adds a fine border and calibration circles at the bottom.
# Works on entire current directory and creates a new subdirectory for the new file(s).
# 
# Usage ./garf-crosseyed+bg *.jpg or ./garf-crosseyed+bg *.png
# 
# May also work on other image formats.
#
# Input must be:
# Side-by-side image(s)
# Total size: 3200x1600
# Left eye : 1600x1600
# Right eye: 1600x1600.
#
# Output saved into ./crosseyed+bg
# Original filenames preserved
#
# Requires: ImageMagick ("magick" command)

# Exit on errors, undefined variables, or failed pipelines
set -euo pipefail

# Create output directory if needed
mkdir -p "crosseyed+bg"

# Process every file given on the command line
for img in "$@"; do

# Skip non-files
[ -f "$img" ] || continue

# Extract filename without path
filename=$(basename "$img")

magick "$img" \

# Create swapped stereo pair:
# crop RIGHT half first, then LEFT half,
# delete original image, then append side-by-side
\( -clone 0 -crop 1600x1600+1600+0 +repage \) \
\( -clone 0 -crop 1600x1600+0+0 +repage \) \
-delete 0 \
+append \

# Add 20px white border around image
-bordercolor white -border 20 \

# Add 140px white footer area underneath
-background white \
-gravity south \
-splice 0x140 \

# Create transparent overlay containing alignment circles.
# Final image size is 3240x1780 after borders/footer.
\( \
-size 3240x1780 xc:none \
-fill none \
-stroke black \
-strokewidth 3 \

# Circle format:
# circle centre_x,centre_y edge_x,edge_y
# Radius = distance between centre and edge points
-draw "circle 820,1720 835,1720" \
-draw "circle 2420,1720 2435,1720" \
\) \

# Overlay circles onto final image
-compose over -composite \

# Save result
"crosseyed+bg/$filename"

echo "Created: crosseyed+bg/$filename"

done

Copy and paste the above script to a text file and save it as “garf-crosseyed+bg”. Don’t forget to change its permissions to make it executable. From the same directory run the following command.

chmod +x garf-crosseyed+bg

Credits

With many thanks to my friend and model Estella Rose for dressing up in her “Dorothy Gale” costume and posing for some test images.

 

Slightly similar posts...

Leave a Reply

Your email address will not be published. Required fields are marked *