MCPcopy Create free account
hub / github.com/cifertech/DisplayKit / preview_image

Function preview_image

server/tft_gif_core.py:165–173  ·  view source on GitHub ↗
(points: list[tuple[int, int, int]], scale: int = 2)

Source from the content-addressed store, hash-verified

163
164
165def 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
176def build_header_text(src_name: str, settings: ConvertSettings, result: ConversionResult) -> str:

Callers 1

convert_endpointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected