Skip to main content

StereoscoPy, stereoscopic 3D image creator

Project description

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

  • Python3
  • Pillow
  • cv2 (optional for auto align)
  • numpy (optional for auto align)

Installation

From the Python Package Index:

pip install stereoscopy

With the optional requirements for the auto align feature:

pip install "stereoscopy[auto_align]"

Or download and run:

python3 setup.py install

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stereoscopy-1.3.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stereoscopy-1.3.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file stereoscopy-1.3.0.tar.gz.

File metadata

  • Download URL: stereoscopy-1.3.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

File hashes

Hashes for stereoscopy-1.3.0.tar.gz
Algorithm Hash digest
SHA256 3ee4d7f2eb3855971a936f7f6b4d5d1cb70136da7deb422177103deaadfa01e0
MD5 d93d0fdea5cf1641eb6053f682b33ab8
BLAKE2b-256 4370aa84d9c232887725409ee61ea046af13d539379713ed28708eb7fc5be478

See more details on using hashes here.

File details

Details for the file stereoscopy-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: stereoscopy-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

File hashes

Hashes for stereoscopy-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e498035bcf9cbd48069f9e404540c24c02cdd6b637f1d427df546428d54e030
MD5 5b1b59c424651fb1cc0c3f14e46ac590
BLAKE2b-256 08ab70ed4347686730e49fce4485793dd1e0c14ec1edc18cecf0ceea2a082a63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page