Code Monkey home page Code Monkey logo

colorspacious's Introduction

colorspacious

Automated test status

Test coverage

Documentation Status

image

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:

http://colorspacious.readthedocs.org/

Installation:

pip install colorspacious

Downloads:

https://pypi.python.org/pypi/colorspacious/

Code and bug tracker:

https://github.com/njsmith/colorspacious

Contact:

Nathaniel J. Smith <[email protected]>

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:

colorspacious's People

Contributors

njsmith avatar futrell avatar stefanv avatar maxnoe avatar tfifie avatar kelsolaar avatar briend avatar cgohlke avatar edwardbetts avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.