A powerful, accurate, and easy-to-use Python library for doing colorspace conversions
Project description
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.
- Documentation:
- Installation:
pip install colorspacious
- Downloads:
- Code and bug tracker:
- Contact:
Nathaniel J. Smith <njs@pobox.com>
- Dependencies:
Python 2.6+, or 3.3+
NumPy
- Developer dependencies (only needed for hacking on source):
nose: needed to run tests
- License:
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. http://www.inf.ufrgs.br/~oliveira/pubs_files/CVD_Simulation/CVD_Simulation.html
Other Python packages with similar functionality that you might want to check out as well or instead:
colour: http://colour-science.org/
colormath: http://python-colormath.readthedocs.org/
ciecam02: https://pypi.python.org/pypi/ciecam02/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for colorspacious-1.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33317422e348a7814cce43153d33e60e64d07b4f8ba8836f4442fe41a7e74789 |
|
MD5 | e113a25456887b2e9babc4196de083c4 |
|
BLAKE2b-256 | 44fc6d36b0af326fc39af9426417baf3aa9e835ca393d23e847fa3df42101b59 |