Skip to main content

StereoscoPy

This is a Python script/library for converting two images into a stereoscopic 3D image: anaglyph, side-by-side (cross-eye and parallel), over/under, wiggle GIF, interlaced and checkerboard.

Requirements

  • Python 3.4+
  • Pillow
  • opencv-python
  • numpy

Installation

From the Python Package Index:

pip install stereoscopy

Command-Line

Help

StereoscoPy --help

Cross-eyed (Right/Left)

With white 5px wide border and image division. Auto aligned, resized to be 450 pixels in width and shifted horizontally by 1 pixel.

StereoscoPy -A -R 400 0 -S 1 0 -x --div 5 --border 5 --bg 255 255 255 0 left.jpg right.jpg cross_eye.jpg

Anaglyph

For red-cyan glasses, there are various methods for creating anaglyphs available.

StereoscoPy -A -R 400 0 -S 1 0 -a left.jpg right.jpg anaglyph_wimmer.jpg
StereoscoPy -A -R 400 0 -S 1 0 -am dubois left.jpg right.jpg anaglyph_dubois.jpg
StereoscoPy -A -R 400 0 -S 1 0 -am gray left.jpg right.jpg anaglyph_gray.jpg
StereoscoPy -A -R 400 0 -S 1 0 -am color left.jpg right.jpg anaglyph_color.jpg
StereoscoPy -A -R 400 0 -S 1 0 -am half-color left.jpg right.jpg anaglyph_half_color.jpg

The Dubois anaglyph method for amber-blue glasses.

StereoscoPy -am dubois --cs amber-blue left.jpg right.jpg anaglyph_dubois_ab.jpg

Wiggle GIF

Without alignment

StereoscoPy -R 400 0 -wt 400 left.jpg right.jpg simple.gif

Shifting an image moves the right image in relation to the left image. An images can be shifted after the auto align to change its center.

StereoscoPy -A -R 400 0 -S 1 0 -wt 200 left.jpg right.jpg align_shift.gif

Squashed Parallel (Left/Right) and Top/Bottom for TVs

StereoscoPy -A -R 400 0 -S 1 0 -ps left.jpg right.jpg tv_left_right.jpg
StereoscoPy -A -R 400 0 -S 1 0 -os left.jpg right.jpg tv_over_under.jpg

Two separate image outputs

Before converting to the stereoscopic outputs, I find this (or a slow wiggle GIF) to be a nice way to check for the correct dimensions, shift and rotation by switching between the two output images in an image viewer.

StereoscoPy --shift 19 30 --crop 20% 0 0 0 --resize 1920 1080 --offset 100% --parallel left.jpg right.jpg out1.jpg out2.jpg

MPO

Saving as an MPO file for the Nintendo 3DS.

StereoscoPy -A -R 400 240 -S 1 0 left.jpg right.jpg PY3D0001.MPO

Misc

20% cropped from the top, resized to 1920x1080 and offset to the right by 100%.

StereoscoPy --crop 20% 0 0 0 --resize 1920 1080 --offset 100% --cross-eye left.jpg right.jpg out.jpg
StereoscoPy -C 20% 0 0 0 -R 1920 1080 -O 100% -x left.jpg right.jpg out.jpg

20% cropped from left and right and resized to be 1080 high and 0 width to preserve the aspect ratio.

StereoscoPy -R 0 1080 -C 0 20% 0 20% -o left.jpg right.jpg out.jpg

Release files for stereoscopy 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stereoscopy 3.0.0
File Size Uploaded
stereoscopy-3.0.0.tar.gz 25.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stereoscopy 3.0.0
File Interpreter ABI Platform
stereoscopy-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.2 kB

Release files / stereoscopy-3.0.0.tar.gz

Download URL stereoscopy-3.0.0.tar.gz
Size 25.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4e330023c5150e209ba6caee6459efbd6c4c9a632dcf3cfe5f6d1ad088e674e6
BLAKE2b-256 checksum
How to use checksums
1950d0a20ef51748e03a5f929f178e98970af686ba21cdb48502eb5c84644d6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / stereoscopy-3.0.0-py3-none-any.whl

Download URL stereoscopy-3.0.0-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4225344b390cc6be15078d238bcf0dc842e87d31c2cd37d9123ae2744d369957
BLAKE2b-256 checksum
How to use checksums
5818117879eebf3211c8c8ecc0a59c28406194c06eb87eec21ccd6f1703db766
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

3.0.1

2 release files

This release

3.0.0 This release

2 release files

2.0.1

3 release files

2.0.0

3 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page