"""Prepare assembly inspection crops without changing any production image.""" 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', (800, 1780, 1100, 2200), 'assembly-foot-clearance-native.png'), ('high/normal/finish-mask.png', (790, 640, 1100, 910), 'assembly-finish-head-native.png'), ('high/normal/finish-mask.png', (700, 1260, 1250, 1500), 'assembly-finish-hands-native.png'), ('high/normal/finish-mask.png', (1150, 750, 1700, 1460), 'assembly-finish-mist-native.png'), ('high/normal/finish-mask.png', (1250, 1490, 1800, 2090), '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)