Defines various deprecated colour models transformations:
These colour models are stated as deprecated because they trade off perceptual relevance for computation speed. They should not be used in the colour science domain although they are useful for image analysis and provide end user software colour selection tools.
They are provided for convenience and completeness.
Warning
Don’t use that! Seriously...
References
[1] | http://en.wikipedia.org/wiki/HSL_and_HSV (Last accessed 10 August 2014) |
[2] | http://alvyray.com/Papers/CG/color78.pdf (Last accessed 10 August 2014) |
Converts from RGB colourspace to HSV colourspace.
Parameters: | RGB (array_like, (3,)) – RGB colourspace matrix. |
---|---|
Returns: | HSV matrix. |
Return type: | ndarray, (3,) |
Notes
References
[3] | http://www.easyrgb.com/index.php?X=MATH&H=20#text20 (Last accessed 18 May 2014) |
Examples
>>> RGB = np.array([0.49019608, 0.98039216, 0.25098039])
>>> RGB_to_HSV(RGB)
array([ 0.2786738..., 0.744 , 0.98039216])
Converts from HSV colourspace to RGB colourspace.
Parameters: | HSV (array_like, (3,)) – HSV colourspace matrix. |
---|---|
Returns: | RGB colourspace matrix. |
Return type: | ndarray, (3,) |
Notes
References
[4] | http://www.easyrgb.com/index.php?X=MATH&H=21#text21 (Last accessed 18 May 2014) |
Examples
>>> HSV = np.array([0.27867384, 0.744, 0.98039216])
>>> HSV_to_RGB(HSV)
array([ 0.4901960..., 0.9803921..., 0.2509803...])
Converts from RGB colourspace to HSL colourspace.
Parameters: | RGB (array_like, (3,)) – RGB colourspace matrix. |
---|---|
Returns: | HSL matrix. |
Return type: | ndarray, (3,) |
Notes
References
[5] | http://www.easyrgb.com/index.php?X=MATH&H=18#text18 (Last accessed 18 May 2014) |
Examples
>>> RGB = np.array([0.49019608, 0.98039216, 0.25098039])
>>> RGB_to_HSL(RGB)
array([ 0.2786738..., 0.9489796..., 0.6156862...])
Converts from HSL colourspace to RGB colourspace.
Parameters: | HSL (array_like, (3,)) – HSL colourspace matrix. |
---|---|
Returns: | RGB colourspace matrix. |
Return type: | ndarray, (3,) |
Notes
References
[6] | http://www.easyrgb.com/index.php?X=MATH&H=19#text19 (Last accessed 18 May 2014) |
Examples
>>> HSL = np.array([0.27867384, 0.94897959, 0.61568627])
>>> HSL_to_RGB(HSL)
array([ 0.4901960..., 0.9803921..., 0.2509803...])
Converts from RGB colourspace to CMY colourspace.
Parameters: | RGB (array_like, (3,)) – RGB colourspace matrix. |
---|---|
Returns: | CMY matrix. |
Return type: | ndarray, (3,) |
Notes
References
[7] | http://www.easyrgb.com/index.php?X=MATH&H=11#text11 (Last accessed 18 May 2014) |
Examples
>>> RGB = np.array([0.49019608, 0.98039216, 0.25098039])
>>> RGB_to_CMY(RGB)
array([ 0.5098039..., 0.0196078..., 0.7490196...])
Converts from CMY colourspace to CMY colourspace.
Parameters: | CMY (array_like, (3,)) – CMY colourspace matrix. |
---|---|
Returns: | RGB colourspace matrix. |
Return type: | ndarray, (3,) |
Notes
References
[8] | http://www.easyrgb.com/index.php?X=MATH&H=12#text12 (Last accessed 18 May 2014) |
Examples
>>> CMY = np.array([0.50980392, 0.01960784, 0.74901961])
>>> CMY_to_RGB(CMY)
array([ 0.4901960..., 0.9803921..., 0.2509803...])
Converts from CMY colourspace to CMYK colourspace.
Parameters: | CMY (array_like, (3,)) – CMY colourspace matrix. |
---|---|
Returns: | CMYK matrix. |
Return type: | ndarray, (4,) |
Notes
References
[9] | http://www.easyrgb.com/index.php?X=MATH&H=13#text13 (Last accessed 18 May 2014) |
Examples
>>> CMY = np.array([0.50980392, 0.01960784, 0.74901961])
>>> CMY_to_CMYK(CMY)
array([ 0.5 , 0. , 0.744 , 0.0196078...])
Converts from CMYK colourspace to CMY colourspace.
Parameters: | CMYK (array_like, (4,)) – CMYK colourspace matrix. |
---|---|
Returns: | CMY matrix. |
Return type: | ndarray, (3,) |
Notes
References
[10] | http://www.easyrgb.com/index.php?X=MATH&H=14#text14 |
Examples
>>> CMYK = np.array([0.5, 0, 0.744, 0.01960784])
>>> CMYK_to_CMY(CMYK)
array([ 0.5098039..., 0.0196078..., 0.7490196...])
Converts from RGB colourspace to hex triplet representation.
Parameters: | RGB (array_like, (3,)) – RGB colourspace matrix. |
---|---|
Returns: | Hex triplet representation. |
Return type: | unicode |
Notes
Examples
>>> RGB = np.array([0.66666667, 0.86666667, 1])
>>> # Doctests skip for Python 2.x compatibility.
>>> RGB_to_HEX(RGB)
'#aaddff'
Converts from hex triplet representation to RGB colourspace.
Parameters: | HEX (unicode) – Hex triplet representation. |
---|---|
Returns: | RGB colourspace matrix. |
Return type: | ndarray, (3,) |
Notes
Examples
>>> HEX = '#aaddff'
>>> HEX_to_RGB(HEX)
array([ 0.6666666..., 0.8666666..., 1. ])