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
- Python 3.4+ or Python 2.7+
- 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:
python 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
Built Distributions
File details
Details for the file stereoscopy-2.0.1.tar.gz
.
File metadata
- Download URL: stereoscopy-2.0.1.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | abc86f8b6cbaf8fa184f03fca0c1eb548a2bf51715ff026339a7c7fcf6256568 |
|
MD5 | 5a6ba2c2367a0dbf54310865ba90ceb6 |
|
BLAKE2b-256 | 76ab1019b495d878904879368cc01e7222b1f3686ecdaf8fcfbd044173098db6 |
File details
Details for the file stereoscopy-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: stereoscopy-2.0.1-py3-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08b36ae9e5534aeda5f562bcacb5becc9248f742e52d62e1d2ce9451db134eeb |
|
MD5 | cf2aec325531af6bd1b627c3cd6f1bf5 |
|
BLAKE2b-256 | 4c7a1325b9d39b38918de6ccd3877a32f2286b55db2ed8f421b7da3d153baa6b |
File details
Details for the file stereoscopy-2.0.1-py2-none-any.whl
.
File metadata
- Download URL: stereoscopy-2.0.1-py2-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 582cf4b79b192c2dde61c330c347c2e91f3a24123924b8de640a0c4beb3cedeb |
|
MD5 | 6044053bfb48dcb8cf4fbdf0360cff6d |
|
BLAKE2b-256 | 43dff08dd048ed2cd74be6b897e3452aa538c238c4e5f09201ad88869767708e |