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

Function dither_adjust

server/tft_gif_core.py:117–121  ·  view source on GitHub ↗
(source: int, x: int, y: int, settings: ConvertSettings)

Source from the content-addressed store, hash-verified

115
116
117def dither_adjust(source: int, x: int, y: int, settings: ConvertSettings) -> int:
118 if settings.dither_mode != "ordered":
119 return source
120 threshold = ORDERED_4X4[y & 3][x & 3] - 8
121 return clamp(source + threshold * 5, 0, 255)
122
123
124def convert_frame(frame: Image.Image, settings: ConvertSettings) -> list[tuple[int, int, int]]:

Callers 1

convert_frameFunction · 0.85

Calls 1

clampFunction · 0.70

Tested by

no test coverage detected