From 94f5eeac25c8c96380d56e25b44c0b283d9589d9 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Tue, 20 Oct 2009 12:10:33 +0200 Subject: [PATCH] Add description of the API to the module docstring. This is not all implemented yet, mostly a description of what I want it to look like in the end. This required figuring out the right matrices based on some of the random ones in Travis' code. Should not be too difficult. --- scikits/image/color/colorconv.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scikits/image/color/colorconv.py b/scikits/image/color/colorconv.py index f6f485b3..39337b12 100644 --- a/scikits/image/color/colorconv.py +++ b/scikits/image/color/colorconv.py @@ -3,6 +3,15 @@ """Functions for converting between color spaces. +The "central" color space in this module is RGB, more specifically the linear +sRGB color space using D65 as a white-point (IEC 61966-2-1). This represents a +standard monitor (w/o gamma correction). + +The API consists of functions to convert to and from RGB as defined above, as +well as a generic function to convert to and from any supported color space +(which is done through RGB in most cases). + + Supported color spaces ---------------------- - RGB @@ -188,6 +197,14 @@ xyz_from_rgb = [[0.412453, 0.357580, 0.180423], rgb_from_xyz = linalg.inv(xyz_from_rgb) +# Matrices from Jain. TODO: find complete reference. +xyz_from_rgbcie = [[0.490, 0.310, 0.200], + [0.177, 0.813, 0.011], + [0.000, 0.010, 0.990]] + +rgbcie_from_xyz = linalg.inv(xyz_from_rgbcie) + + #------------------------------------------------------------- # The conversion functions that make use of the matrices above #-------------------------------------------------------------