Tick_Forge/tools/make_gif.py
9 lines
577 B
Python
"""Slideshow GIF from the four real window screenshots (market/shot_1..4.png): for the article, not the Market listing."""
from pathlib import Path
from PIL import Image
M = Path(__file__).resolve().parent.parent / "market"
fr = [Image.open(M / ("shot_%d.png" % i)).convert("RGB").crop((20, 20, 1075, 650)).resize((880, 520), Image.LANCZOS) for i in (1, 2, 3, 4)]
pal = [f.quantize(128, dither=Image.NONE) for f in fr]
pal[0].save(M / "tick_forge_demo.gif", save_all=True, append_images=pal[1:], duration=2200, loop=0, optimize=True)
print("wrote", M / "tick_forge_demo.gif")