colorex.cex_keras : keras layers for color transformation

colorex keras layers

colorex.cex_keras.color_space(from_space, to_space, values)[source]

lookup color transform from_space to_space apply transform and return output tensor short circuit compute if from_space == to_space

colorex.cex_keras.color_space_numpy(from_space, to_space, values)[source]

numpy wrapper for backend color transform

colorex.cex_keras.lab_to_rgb(lab)[source]

lab > xyz > rgb

colorex.cex_keras.lab_to_srgb(lab)[source]

lab > xyz > srgb

colorex.cex_keras.lab_to_xyy(lab)[source]

lab > xyz > xyy

colorex.cex_keras.lab_to_xyz(lab)[source]

convert from lab to xyz color space assuming a D65 whitepoint + 2deg angle

colorex.cex_keras.rgb_to_lab(rgb)[source]

rgb -> xyz -> lab

colorex.cex_keras.rgb_to_luminance(rgb, luma_weights=(0.2126, 0.7152, 0.0722))[source]

luminance of a color array, or higher dim color images

colorex.cex_keras.rgb_to_srgb(rgb)[source]

convert from linear rgb to a gamma 2.4 color space

colorex.cex_keras.rgb_to_xyy(rgb)[source]

rgb > xyz > xyy

colorex.cex_keras.rgb_to_xyz(rgb)[source]

convert from gamma 1.0 RGB color space to XYZ

colorex.cex_keras.rgb_to_ycbcr(rgb)[source]
convert from rgb color space to YCbCr

rgb: rgb color space YCbCr: luminance with 2 chroma channels

https://en.wikipedia.org/wiki/YCbCr http://www.brucelindbloom.com/index.html?Eqn_XYZ_to_xyY.html

colorex.cex_keras.srgb_to_lab(srgb)[source]

srgb -> xyz -> lab

colorex.cex_keras.srgb_to_rgb(srgb)[source]

convert from a gamma 2.4 color space to linear rgb

colorex.cex_keras.srgb_to_xyy(srgb)[source]

srgb > rgb > xyz > xyy

colorex.cex_keras.srgb_to_xyz(srgb)[source]

srgb > rgb > xyz

colorex.cex_keras.xyy_to_lab(xyy)[source]

xyz > xyz > lab

colorex.cex_keras.xyy_to_rgb(xyy)[source]

xyy > xyz > rgb

colorex.cex_keras.xyy_to_srgb(xyy)[source]

xyy > xyz > rgb > srgb

colorex.cex_keras.xyy_to_xyz(xyY)[source]
convert from xyY color space to XYZ

xyY: normalized chromaticity with xy in 0-1, Y in 0-inf XYZ: consistent units for each component

https://en.wikipedia.org/wiki/CIE_1931_color_space http://www.brucelindbloom.com/index.html?Eqn_xyY_to_XYZ.html

colorex.cex_keras.xyz_to_lab(xyz)[source]

convert from a CIEXYZ space to CIELa*b*

colorex.cex_keras.xyz_to_rgb(xyz)[source]

convert from XYZ to a gamma 1.0 RGB color space

colorex.cex_keras.xyz_to_srgb(xyz)[source]

xyz > rgb > srgb

colorex.cex_keras.xyz_to_xyy(XYZ)[source]
convert from XYZ color space to xyY

XYZ: consistent units for each component xyY: normalized chromaticity with xy in 0-1, Y in 0-inf

https://en.wikipedia.org/wiki/CIE_1931_color_space http://www.brucelindbloom.com/index.html?Eqn_XYZ_to_xyY.html

colorex.cex_keras.ycbcr_to_rgb(ycbcr)[source]
convert from YCbCr color space to srgb

YCbCr: luminance with 2 chroma channels srgb: rgb color space

https://en.wikipedia.org/wiki/YCbCr http://www.brucelindbloom.com/index.html?Eqn_XYZ_to_xyY.html