(points: list[tuple[int, int, int]], max_points: int)
| 96 | |
| 97 | |
| 98 | def reduce_points_evenly(points: list[tuple[int, int, int]], max_points: int) -> list[tuple[int, int, int]]: |
| 99 | if len(points) <= max_points: |
| 100 | return points |
| 101 | reduced: list[tuple[int, int, int]] = [] |
| 102 | step = len(points) / max_points |
| 103 | for i in range(max_points): |
| 104 | reduced.append(points[int(i * step)]) |
| 105 | return reduced |
| 106 | |
| 107 | |
| 108 | def fit_frame(frame: Image.Image, settings: ConvertSettings) -> Image.Image: |