Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
A Python script to make red/cyan 3D photos
from PIL import Image
import sys
# Check arguments
if len(sys.argv) < 3:
print "Usage: python <leftimage> <rightimage> <3doutputname>"
# Open the left and right images
imLeft =[1])
imRight =[2])
# Split the images into Red, Green, and Blue
lRed, lGreen, lBlue = imLeft.split()
rRed, rGreen, rBlue = imRight.split()
# The 3D image is the Red from the Right image
# And the Green and Blue from the Left one
im3D = Image.merge('RGB', [rRed, lGreen, lBlue])
# Show it
# Save it if we have an output filename
if len(sys.argv) > 3:[3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment