from pathlib import Path from PIL import Image, ImageDraw, ImageFont def make_dummy_frame(path: Path, width: int, height: int, text: str, step: int) -> None: image = Image.new("RGB", (width, height), color=(25 + step * 5 % 200, 40, 60)) draw = ImageDraw.Draw(image) font = ImageFont.load_default() draw.text((16, 16), text, fill=(240, 240, 240), font=font) draw.text((16, 38), f"frame={step}", fill=(220, 220, 220), font=font) image.save(path, format="JPEG", quality=90)