# Critique: the model's edges (from the concept-camera render) drawn over the user's concept, and a 50/50 blend import os, numpy as np from PIL import Image, ImageFilter ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) c = Image.open(os.path.join(ROOT, "reference", "user_concept.jpg")).convert("RGB") m = Image.open(os.path.join(ROOT, "previews", "compare", "concept_render.png")).convert("RGB") box = (170, 85, 720, 420) cc = c.crop(box).resize((1100, 670), Image.LANCZOS) mm = m.crop(box).resize((1100, 670), Image.LANCZOS) g = np.array(mm.convert("L").filter(ImageFilter.GaussianBlur(1.0)).filter(ImageFilter.FIND_EDGES)).astype(float) e = g > 18 out = np.array(cc).copy() out[e] = (255, 0, 255) Image.fromarray(out).save(os.path.join(ROOT, "critique", "round1", "concept_edges_over.png")) Image.blend(cc, mm, 0.5).save(os.path.join(ROOT, "critique", "round1", "concept_blend.png")) # mean colours of hull areas: sample patches (original picture px) on the concept and on the model render pts = {"hull_upper_flank": (420, 175), "hull_aft_flank": (300, 230), "hull_lower_flank": (430, 330), "hull_top": (470, 140)} for k, (x, y) in pts.items(): pc = np.array(c.crop((x-4, y-4, x+4, y+4))).reshape(-1, 3).mean(0) pm = np.array(m.crop((x-4, y-4, x+4, y+4))).reshape(-1, 3).mean(0) print(k, "concept", pc.round(), "model", pm.round())