okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-q36-vp (Qwen3.6 parallel requests and pictures)db4dd65e5

main
1.2 KiB27 linesraw
1"""make_big_picture.py OUT : a 1024x1024 test picture (about 1,024 image tokens, a prompt that spans several chunks): a heading, a
2few lines of small text and coloured shapes on white."""
3import sys
4from PIL import Image, ImageDraw, ImageFont
5
6im = Image.new("RGB", (1024, 1024), "white")
7d = ImageDraw.Draw(im)
8
9
10def font(size, bold=True):
11    for f in (("arialbd.ttf" if bold else "arial.ttf"), "C:/Windows/Fonts/arialbd.ttf",
12              "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", "/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf"):
13        try:
14            return ImageFont.truetype(f, size)
15        except OSError:
16            pass
17    return ImageFont.load_default()
18
19
20d.text((90, 60), "INVOICE 20261014", fill="black", font=font(96))
21d.text((90, 200), "Total due: 1337 EUR", fill=(20, 20, 160), font=font(64))
22for i, line in enumerate(["Item 1   widgets   x 12", "Item 2   gears     x 7", "Item 3   springs   x 30"]):
23    d.text((90, 320 + 70 * i), line, fill="black", font=font(48, False))
24d.ellipse([560, 600, 960, 1000], fill=(30, 160, 60))
25d.rectangle([90, 640, 430, 980], fill=(220, 30, 30))
26im.save(sys.argv[1])
27print("wrote", sys.argv[1])