From 26327728d054e5490d2b5d15b63eafdb92d49cf6 Mon Sep 17 00:00:00 2001 From: Its-my-right Date: Sun, 20 Jul 2025 19:48:21 +0200 Subject: [PATCH] Update rainbow_artifacts_eraser.py add param s=luminance.shape to irfft2 to avoid dimensions error on luminance --- kindlecomicconverter/rainbow_artifacts_eraser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kindlecomicconverter/rainbow_artifacts_eraser.py b/kindlecomicconverter/rainbow_artifacts_eraser.py index 7135e4d..e1fb5fc 100644 --- a/kindlecomicconverter/rainbow_artifacts_eraser.py +++ b/kindlecomicconverter/rainbow_artifacts_eraser.py @@ -213,7 +213,7 @@ def erase_rainbow_artifacts(img, is_color): # Process only the luminance channel fft_spectrum = fourier_transform_image(luminance) clean_spectrum = attenuate_diagonal_frequencies(fft_spectrum) - clean_luminance = np.fft.irfft2(clean_spectrum) + clean_luminance = np.fft.irfft2(clean_spectrum, s=luminance.shape) # Normalize and clip luminance clean_luminance = np.clip(clean_luminance, 0, 255)