Created
April 16, 2018 16:25
-
-
Save astrograzl/e837040cc0c26789abca9f96484ed0bb to your computer and use it in GitHub Desktop.
Transform screenshot into fullframe
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
#!python3 | |
# coding: utf-8 | |
"""Transform screenshot into fullframe""" | |
import sys | |
from PIL import Image | |
from glob import glob | |
from progressbar import ProgressBar | |
width = 1920 | |
hight = 1080 | |
comics = glob("movie/*.png") | |
progbar = ProgressBar() | |
for strip in progbar(comics): | |
image = Image.open(strip) | |
w, h = image.size | |
x = (width - w) // 2 | |
y = (hight - h) // 2 | |
frame = Image.new("RGB", (width, hight), "black") | |
frame.paste(image, (x, y)) | |
frame.save(strip) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment