"""Retain native-resolution assembly inspection crops; never alter production art.""" from pathlib import Path from PIL import Image root = Path(__file__).resolve().parent.parent items = [ ('high/normal/card.png', (0, 0, 2000, 370), 'assembly-title-native.png'), ('high/normal/card.png', (0, 2150, 2000, 2800), 'assembly-footer-native.png'), ('high/normal/card.png', (0, 1380, 330, 1650), 'assembly-hand-clearance-native.png'), ('high/normal/finish-mask.png', (150, 440, 600, 940), 'assembly-finish-cain-face-native.png'), ('high/normal/finish-mask.png', (1450, 480, 1850, 1040), 'assembly-finish-abel-face-native.png'), ('high/normal/finish-mask.png', (0, 1400, 570, 1740), 'assembly-finish-cain-hands-native.png'), ('high/normal/finish-mask.png', (1390, 1460, 1950, 1770), 'assembly-finish-abel-hands-native.png'), ('high/normal/finish-mask.png', (770, 980, 1230, 1880), 'assembly-finish-background-native.png'), ] for source, bounds, target in items: with Image.open(root / source) as image: image.crop(bounds).save(root / 'review' / target)