47 lines
1.6 KiB
Python
47 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
"""Create non-production illustration review evidence for BP-016 candidate 01."""
|
|
from pathlib import Path
|
|
|
|
from PIL import Image
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
REPO = next(p for p in ROOT.parents if (p / "docs/card-art-brief.md").is_file())
|
|
SOURCE = ROOT / "source"
|
|
OUT = ROOT / "review/candidate-01"
|
|
OUT.mkdir(parents=True, exist_ok=True)
|
|
|
|
image = Image.open(SOURCE / "art-native-candidate-01.png").convert("RGBA")
|
|
for width in (1000, 500, 250):
|
|
image.resize((width, width * 7 // 5), Image.Resampling.LANCZOS).save(
|
|
OUT / f"art-{width}.png"
|
|
)
|
|
|
|
master = image.resize((2000, 2800), Image.Resampling.LANCZOS)
|
|
overlay = Image.open(
|
|
REPO / "artifacts/layers/rare/v3/exports/overlay-normal-2000.png"
|
|
).convert("RGBA")
|
|
Image.alpha_composite(master, overlay).resize(
|
|
(1000, 1400), Image.Resampling.LANCZOS
|
|
).save(OUT / "layout-guide-normal.png")
|
|
|
|
crops = {
|
|
"figure-100.png": (35, 210, 1060, 1484, 1),
|
|
"face-hair-beard-200.png": (315, 205, 650, 570, 2),
|
|
"chest-hand-300.png": (245, 570, 555, 835, 3),
|
|
"extended-hand-300.png": (780, 635, 1060, 915, 3),
|
|
"upper-background-100.png": (0, 0, 1060, 470, 1),
|
|
"left-architecture-200.png": (0, 0, 315, 925, 2),
|
|
"right-architecture-100.png": (610, 155, 1060, 1050, 1),
|
|
"lower-background-100.png": (0, 1025, 1060, 1484, 1),
|
|
}
|
|
for name, (left, top, right, bottom, scale) in crops.items():
|
|
crop = image.crop((left, top, right, bottom))
|
|
if scale != 1:
|
|
crop = crop.resize(
|
|
(crop.width * scale, crop.height * scale), Image.Resampling.NEAREST
|
|
)
|
|
crop.save(OUT / name)
|
|
|
|
print("Wrote BP-016 candidate-01 art-review evidence")
|