File size: 1,388 Bytes
d3ce0b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from pathlib import Path
from PIL import Image, ImageDraw, ImageFont

out = Path(__file__).with_name("thumbnail.png")
im = Image.new("RGB", (1200, 630), (12, 23, 37))
d = ImageDraw.Draw(im)
font = "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
bold = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"
small = ImageFont.truetype(font, 25)
label = ImageFont.truetype(bold, 30)
title = ImageFont.truetype(bold, 81)

d.rounded_rectangle((50, 43, 210, 90), radius=17, fill=(30, 84, 75))
d.text((68, 52), "alphaBell", font=small, fill=(86, 221, 193))
d.text((50, 136), "ONE GREEN TEST", font=title, fill=(245, 249, 249))
d.text((50, 239), "CAN LIE.", font=title, fill=(86, 221, 193))
d.text((52, 348), "Five hidden correctness traps in generated code.", font=ImageFont.truetype(font, 31), fill=(184, 204, 215))

labels = ["TAIL", "STRIDE", "OVERFLOW", "ROWS", "ALIAS"]
x = 52
for i, text in enumerate(labels):
    width = d.textbbox((0, 0), text, font=label)[2] + 47
    d.rounded_rectangle((x, 460, x + width, 520), radius=16, fill=(26, 51, 68), outline=(64, 119, 108), width=2)
    d.text((x + 23, 475), text, font=label, fill=(231, 246, 243))
    x += width + 13

d.line((52, 563, 1147, 563), fill=(69, 93, 112), width=2)
d.text((52, 584), "Pick the second test. See the actual mismatch.", font=small, fill=(151, 181, 194))
im.save(out, optimize=True)
print(out, out.stat().st_size)