A powerful, accurate, and easy-to-use Python library for doing colorspace conversions
Colorspacious is a powerful, accurate, and easy-to-use library for performing colorspace conversions.
In addition to the most common standard colorspaces (sRGB, XYZ, xyY, CIELab, CIELCh), we also include: color vision deficiency (“color blindness”) simulations using the approach of Machado et al (2009); a complete implementation of CIECAM02; and the perceptually uniform CAM02-UCS / CAM02-LCD / CAM02-SCD spaces proposed by Luo et al (2006).
To get started, simply write:
from colorspacious import cspace_convert Jp, ap, bp = cspace_convert([64, 128, 255], "sRGB255", "CAM02-UCS")
This converts an sRGB value (represented as integers between 0-255) to CAM02-UCS J’a’b’ coordinates (assuming standard sRGB viewing conditions by default). This requires passing through 4 intermediate colorspaces; cspace_convert automatically finds the optimal route and applies all conversions in sequence:
This function also of course accepts arbitrary NumPy arrays, so converting a whole image is just as easy as converting a single value.
Other Python packages with similar functionality that you might want to check out as well or instead:
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|File Name & Checksum SHA256 Checksum Help||Version||File Type||Upload Date|
|colorspacious-1.1.0-py2.py3-none-any.whl (37.6 kB) Copy SHA256 Checksum SHA256||py2.py3||Wheel||Nov 10, 2016|
|colorspacious-1.1.0.zip (698.7 kB) Copy SHA256 Checksum SHA256||–||Source||Nov 10, 2016|