diff --git a/src/repixelizer/io.py b/src/repixelizer/io.py index c0a2401..3e345cf 100644 --- a/src/repixelizer/io.py +++ b/src/repixelizer/io.py @@ -41,12 +41,6 @@ def box_resize(rgba: np.ndarray, width: int, height: int) -> np.ndarray: return np.asarray(resized, dtype=np.float32) / 255.0 -def bilinear_resize(rgba: np.ndarray, width: int, height: int) -> np.ndarray: - image = Image.fromarray(np.clip(np.rint(rgba * 255.0), 0, 255).astype(np.uint8), mode="RGBA") - resized = image.resize((width, height), resample=Image.Resampling.BILINEAR) - return np.asarray(resized, dtype=np.float32) / 255.0 - - def lanczos_resize(rgba: np.ndarray, width: int, height: int) -> np.ndarray: image = Image.fromarray(np.clip(np.rint(rgba * 255.0), 0, 255).astype(np.uint8), mode="RGBA") resized = image.resize((width, height), resample=Image.Resampling.LANCZOS) diff --git a/src/repixelizer/metrics.py b/src/repixelizer/metrics.py index 65ae3a6..f781ff7 100644 --- a/src/repixelizer/metrics.py +++ b/src/repixelizer/metrics.py @@ -496,19 +496,3 @@ def _motif_blocks(premul: np.ndarray) -> np.ndarray: centered = blocks - np.mean(blocks, axis=-2, keepdims=True) scale = np.maximum(1e-4, np.mean(np.abs(centered), axis=(-2, -1), keepdims=True)) return centered / scale - - -def lattice_source_rgba( - source_rgba: np.ndarray, - *, - target_width: int, - target_height: int, - alpha_threshold: float = 0.05, -) -> tuple[np.ndarray, float]: - reference = build_source_lattice_reference( - source_rgba, - target_width=target_width, - target_height=target_height, - alpha_threshold=alpha_threshold, - ) - return reference.mean_rgba, reference.dispersion