Remove clutter

This commit is contained in:
Andras Schmelczer 2024-06-21 22:19:55 +01:00
parent 9d5fa59584
commit cd2ad332e4
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
2 changed files with 0 additions and 43 deletions

View file

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

View file

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