Skip to content

Instantly share code, notes, and snippets.

@astrograzl
Created April 16, 2018 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astrograzl/e837040cc0c26789abca9f96484ed0bb to your computer and use it in GitHub Desktop.
Save astrograzl/e837040cc0c26789abca9f96484ed0bb to your computer and use it in GitHub Desktop.
Transform screenshot into fullframe
#!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