| 163 | |
| 164 | |
| 165 | def preview_image(points: list[tuple[int, int, int]], scale: int = 2) -> Image.Image: |
| 166 | img = Image.new("RGB", (SCREEN_W, SCREEN_H), "black") |
| 167 | pix = img.load() |
| 168 | for x, y, shade in points: |
| 169 | if 0 <= x < SCREEN_W and 0 <= y < SCREEN_H: |
| 170 | pix[x, y] = (shade, shade, shade) |
| 171 | if scale != 1: |
| 172 | return img.resize((SCREEN_W * scale, SCREEN_H * scale), Image.Resampling.NEAREST) |
| 173 | return img |
| 174 | |
| 175 | |
| 176 | def build_header_text(src_name: str, settings: ConvertSettings, result: ConversionResult) -> str: |