I hit a bit of a weird wall... when I try running this in my code, I'm getting incorrect results...
offset = int(x * 3)
print(x, "R : ", data[offset], " G : ", data[offset + 1], " B : ", data[offset + 2], "Offset ", offset)
rgb = (reRange(255, 0, 1.0, 0, data[offset]),
reRange(255, 0, 1.0, 0, data[offset + 1]),
reRange(255, 0, 1.0, 0, data[offset + 2]))
print("RGB : ", rgb)
hsl = rgb_to_hsluv(rgb)
print("HSL : ", hsl)
hsl[2] = hsl[2] * lumi
# h = hsl[0] * hue
hsl[1] = hsl[1] * sat
print("HSL : ", hsl)
toRgb = hsluv_to_rgb(hsl)
print("pRGB: ", toRgb)
data[offset] = int(reRange(1.0, 0.0, 255.0, 0.0, toRgb[0]))
data[offset + 1] = int(reRange(1.0, 0.0, 255.0, 0.0, toRgb[1]))
data[offset + 2] = int(reRange(1.0, 0.0, 255.0, 0.0, toRgb[2]))
print(x, "R: ", data[offset], " G: ", data[offset + 1], " B: ", data[offset + 2], "\n\n")
319996 R : 14 G : 6 B : 6 Offset 959988
RGB : (0.054901960784313725, 0.023529411764705882, 0.023529411764705882)
HSL : [12.177050630062146, 21.184609202372744, 2.138737995579452]
HSL : [12.177050630062146, 10.592304601186372, 2.138737995579452]
pRGB: [0.0436894824389459, 0.027017028218122827, 0.027017028218122255]
319996 R: 11 G: 6 B: 6
319997 R : 255 G : 17 B : 5 Offset 959991
RGB : (1.0, 0.06666666666666667, 0.0196078431372549)
HSL : [12.482352433878221, 99.99999999999856, 53.68125203861338]
HSL : [12.482352433878221, 49.99999999999928, 53.68125203861338]
pRGB: [0.8152300064437905, 0.358083498149423, 0.35453935730595854]
319997 R: 207 G: 91 B: 90
319998 R : 5 G : 255 B : 21 Offset 959994
RGB : (0.0196078431372549, 1.0, 0.08235294117647059)
HSL : [127.93115964717315, 99.9999999999918, 87.77728072672164]
HSL : [127.93115964717315, 49.9999999999959, 87.77728072672164]
pRGB: [0.6067511284818852, 0.9409300618470916, 0.609497221091625]
319998 R: 154 G: 239 B: 155
319999 R : 7 G : 8 B : 255 Offset 959997
RGB : (0.027450980392156862, 0.03137254901960784, 1.0)
HSL : [265.86195104698476, 99.99999999999959, 32.784073217562245]
HSL : [265.86195104698476, 49.999999999999794, 32.784073217562245]
pRGB: [0.2621364290105094, 0.2623202526490048, 0.5939211583491713]
319999 R: 66 G: 66 B: 151
Processing min : 0.0 max : 255.0 Lumi : 1.0 Hue : 0.0 Sat : 0.5
the R G B flips a lot... is this a lib bug or did I miss something?
All it does is change saturation from whatever it is to 50% of it.