from PIL import Image, ImageDraw
R = "raw/uishot_gfx_%s.png"
def lab(d, x, y, t):
    d.rectangle((x, y, x + 200, y + 22), fill=(0, 0, 0)); d.text((x + 6, y + 5), t, fill=(255, 255, 255))
# crops natifs 800x450 : ombres fines (joueur), usure (mur gauche), brume rue (fond)
crops = [("ombres_fines_off", "ombres_fines", (450, 450, 1250, 900)), ("usure_off", "usure", (0, 60, 800, 510)),
         ("brume_off", "brume", (400, 0, 1200, 450))]
s = Image.new("RGB", (1600, 1350)); d = ImageDraw.Draw(s)
for i, (a, b, box) in enumerate(crops):
    for j, n in enumerate((a, b)):
        s.paste(Image.open(R % n).convert("RGB").crop(box), (j * 800, i * 450)); lab(d, j * 800, i * 450, n)
s.save("crops.jpg", quality=88)
singles = ["traces", "ruissellement", "halos", "vitres_jour", "vitres_nuit", "mouille", "egout", "pluie_pres"]
s = Image.new("RGB", (1600, 1800)); d = ImageDraw.Draw(s)
for i, n in enumerate(singles):
    x, y = (i % 2) * 800, (i // 2) * 450
    s.paste(Image.open(R % n).convert("RGB").resize((800, 450), Image.LANCZOS), (x, y)); lab(d, x, y, n)
s.save("singles.jpg", quality=88)
