1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 01:36:27 +00:00

Update rainbow_artifacts_eraser.py

add param s=luminance.shape to irfft2 to avoid dimensions error on luminance
This commit is contained in:
Its-my-right
2025-07-20 19:48:21 +02:00
committed by Alex Xu
parent 61bfb0a51f
commit 26327728d0

View File

@@ -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)