diff --git a/src/editor/operations/__init__.py b/src/editor/operations/__init__.py index 9c7da16..5da6215 100644 --- a/src/editor/operations/__init__.py +++ b/src/editor/operations/__init__.py @@ -1,5 +1,4 @@ from .add_noise import add_noise -from .change_temperature import change_temperature from .add_random_colour_spill import add_random_colour_spill from .gamma import adjust_gamma, get_random_gamma from .get_colour_lut import get_random_saturation_per_hue_lut, get_random_brightness_lut diff --git a/src/editor/operations/change_temperature.py b/src/editor/operations/change_temperature.py deleted file mode 100644 index 1087fdd..0000000 --- a/src/editor/operations/change_temperature.py +++ /dev/null @@ -1,42 +0,0 @@ -from PIL import Image - -kelvin_table = { - 1000: (255, 56, 0), - 1500: (255, 109, 0), - 2000: (255, 137, 18), - 2500: (255, 161, 72), - 3000: (255, 180, 107), - 3500: (255, 196, 137), - 4000: (255, 209, 163), - 4500: (255, 219, 186), - 5000: (255, 228, 206), - 5500: (255, 236, 224), - 6000: (255, 243, 239), - 6500: (255, 249, 253), - 7000: (245, 243, 255), - 7500: (235, 238, 255), - 8000: (227, 233, 255), - 8500: (220, 229, 255), - 9000: (214, 225, 255), - 9500: (208, 222, 255), - 10000: (204, 219, 255), -} - - -def change_temperature(image: Image, temperature: float) -> Image: - r, g, b = kelvin_table[temperature] - matrix = ( - r / 255.0, - 0.0, - 0.0, - 0.0, - 0.0, - g / 255.0, - 0.0, - 0.0, - 0.0, - 0.0, - b / 255.0, - 0.0, - ) - return image.convert("RGB", matrix)