mirror of
https://github.com/KrisKennaway/ii-pix.git
synced 2024-05-31 14:41:32 +00:00
Uncomment
This commit is contained in:
parent
7609297f0d
commit
3159a09c27
|
@ -14,23 +14,23 @@ def srgb_to_linear_array(a: np.ndarray, gamma=2.4) -> np.ndarray:
|
||||||
return np.where(a <= 0.04045, a / 12.92, ((a + 0.055) / 1.055) ** gamma)
|
return np.where(a <= 0.04045, a / 12.92, ((a + 0.055) / 1.055) ** gamma)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# print("Precomputing conversion matrix from 24-bit RGB to CAM16UCS colour "
|
print("Precomputing conversion matrix from 24-bit RGB to CAM16UCS colour "
|
||||||
# "space")
|
"space")
|
||||||
# # Compute matrix of all 24-bit RGB values, normalized to 0..1 range
|
# Compute matrix of all 24-bit RGB values, normalized to 0..1 range
|
||||||
# bits24 = np.arange(2 ** 24, dtype=np.uint32).reshape(-1, 1)
|
bits24 = np.arange(2 ** 24, dtype=np.uint32).reshape(-1, 1)
|
||||||
# all_rgb24 = np.concatenate(
|
all_rgb24 = np.concatenate(
|
||||||
# [bits24 >> 16 & 0xff, bits24 >> 8 & 0xff, bits24 & 0xff],
|
[bits24 >> 16 & 0xff, bits24 >> 8 & 0xff, bits24 & 0xff],
|
||||||
# axis=1).astype(np.float32) / 255
|
axis=1).astype(np.float32) / 255
|
||||||
# del bits24
|
del bits24
|
||||||
#
|
|
||||||
# with colour.utilities.suppress_warnings(colour_usage_warnings=True):
|
with colour.utilities.suppress_warnings(colour_usage_warnings=True):
|
||||||
# # Compute matrix of corresponding CAM16UCS colour values, indexed
|
# Compute matrix of corresponding CAM16UCS colour values, indexed
|
||||||
# # by 24-bit RGB value
|
# by 24-bit RGB value
|
||||||
# rgb24_to_cam16ucs = colour.convert(all_rgb24, "RGB", "CAM16UCS").astype(
|
rgb24_to_cam16ucs = colour.convert(all_rgb24, "RGB", "CAM16UCS").astype(
|
||||||
# np.float32)
|
np.float32)
|
||||||
# del all_rgb24
|
del all_rgb24
|
||||||
# np.save("data/rgb24_to_cam16ucs.npy", rgb24_to_cam16ucs)
|
np.save("data/rgb24_to_cam16ucs.npy", rgb24_to_cam16ucs)
|
||||||
# del rgb24_to_cam16ucs
|
del rgb24_to_cam16ucs
|
||||||
|
|
||||||
print("Precomputing conversion matrix from 12-bit //gs RGB to CAM16UCS "
|
print("Precomputing conversion matrix from 12-bit //gs RGB to CAM16UCS "
|
||||||
"colour space")
|
"colour space")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user