(source: int, x: int, y: int, settings: ConvertSettings)
| 115 | |
| 116 | |
| 117 | def 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 | |
| 124 | def convert_frame(frame: Image.Image, settings: ConvertSettings) -> list[tuple[int, int, int]]: |
no test coverage detected