Created
January 31, 2020 04:16
-
-
Save JackDesBwa/317ef94cc8c67c02c78c7e4b1e038b1a to your computer and use it in GitHub Desktop.
Transform MPO stereoscopic images into SBS parallel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
from PIL import Image | |
for p in sys.argv[1:]: | |
path_in = p | |
path_out = path_in.replace('.mpo', '.sbs.jpg') | |
imr = Image.open(path_in) | |
imr.seek(1) | |
iml = Image.open(path_in) | |
im = Image.new("RGB", (iml.size[0]+imr.size[0], max(iml.size[1], imr.size[1]))) | |
im.paste(iml, (0, 0)) | |
im.paste(imr, (iml.size[0], 0)) | |
im.save(path_out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment