"""Prepare review crops; do not modify production images.""" from pathlib import Path from PIL import Image root = Path(__file__).resolve().parent.parent items = [ ('high/normal/card.png', (600, 110, 1400, 285), 'assembly-title-native.png'), ('high/normal/card.png', (250, 2250, 1750, 2680), 'assembly-footer-native.png'), ('high/normal/card.png', (600, 2020, 1400, 2250), 'assembly-foot-clearance-native.png'), ('high/normal/finish-mask.png', (560, 575, 880, 955), 'assembly-finish-head-native.png'), ('high/normal/finish-mask.png', (300, 1130, 1060, 1510), 'assembly-finish-hands-native.png'), ('high/normal/finish-mask.png', (1420, 430, 1840, 1250), 'assembly-finish-wife-native.png'), ('high/normal/finish-mask.png', (1520, 1310, 1840, 2050), 'assembly-finish-terrain-native.png'), ] for source, bounds, target in items: with Image.open(root / source) as image: image.crop(bounds).save(root / 'review' / target)