"""The picture beside the render from its camera, and the render's outline over the picture. python tg_pair.py TAG -> previews/compare/_pair.png (picture | render), _blend.png (50 % mix) """ import sys from pathlib import Path from PIL import Image ROOT = Path(__file__).resolve().parents[1] CMP = ROOT / "previews" / "compare" tag = sys.argv[1] pic = Image.open(ROOT / "reference" / "user_picture.jpg").convert("RGB") ren = Image.open(CMP / f"{tag}_render.png").convert("RGB").resize(pic.size) pair = Image.new("RGB", (pic.width * 2 + 8, pic.height), (255, 255, 255)) pair.paste(pic, (0, 0)) pair.paste(ren, (pic.width + 8, 0)) pair.save(CMP / f"{tag}_pair.png") Image.blend(pic, ren, 0.5).save(CMP / f"{tag}_blend.png") print(CMP / f"{tag}_pair.png")