Skip to content

Instantly share code, notes, and snippets.

@OterLabb
Created January 31, 2019 10:33
Show Gist options
  • Save OterLabb/2343a054df1abe51c8cde80fce1fe46f to your computer and use it in GitHub Desktop.
Save OterLabb/2343a054df1abe51c8cde80fce1fe46f to your computer and use it in GitHub Desktop.
from PIL import Image
left = 290
up = 1852
right = 357
bottom = 1915
image_list = [f for f in glob.glob("*.jpg")]
num = 0
for f in image_list:
img = Image.open(f)
area = (left, up, right, bottom)
cropped_img = img.crop(area)
name = 'bilde' + str(num) + '.png'
cropped_img.save(name)
num = num +1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment