Skip to content
A powerful, accurate, and easy-to-use Python library for doing colorspace conversions
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
colorspacious Post-release engineering for v1.1.2 Apr 8, 2018
doc Post-release engineering for v1.1.2 Apr 8, 2018
.coveragerc s/pycam02ucs/colorspacious/ Jul 4, 2015
.travis.yml [travis] switch to codecov Nov 10, 2016
LICENSE.txt Rename LICENSE to LICENSE.txt Nov 10, 2016 Implement CIECAM02 properly Jul 12, 2014
README.rst Update zenodo badges Nov 10, 2016
release-checklist.txt Add release checklist. Apr 2, 2018
setup.cfg setup.cfg Jul 8, 2015



Automated test status Test coverage Documentation Status

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.

pip install colorspacious
Code and bug tracker:
Nathaniel J. Smith <>
  • Python 2.6+, or 3.3+
  • NumPy
Developer dependencies (only needed for hacking on source):
  • nose: needed to run tests
MIT, see LICENSE.txt for details.
References for algorithms we implement:
  • Luo, M. R., Cui, G., & Li, C. (2006). Uniform colour spaces based on CIECAM02 colour appearance model. Color Research & Application, 31(4), 320–330. doi:10.1002/col.20227
  • Machado, G. M., Oliveira, M. M., & Fernandes, L. A. (2009). A physiologically-based model for simulation of color vision deficiency. Visualization and Computer Graphics, IEEE Transactions on, 15(6), 1291–1298.

Other Python packages with similar functionality that you might want to check out as well or instead:

You can’t perform that action at this time.