summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-05 18:48:03 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-05 18:48:03 +0100
commitab75b6858533f8088c02da7e67df8b4f5062902a (patch)
tree325e85977adf83f4eb285d1e2ee3881ea5442dbf
parentinfo: doc ciexyz_to_cielab cielab_to_xiexyz delta_e (diff)
downloadblueshift-ab75b6858533f8088c02da7e67df8b4f5062902a.tar.gz
blueshift-ab75b6858533f8088c02da7e67df8b4f5062902a.tar.bz2
blueshift-ab75b6858533f8088c02da7e67df8b4f5062902a.tar.xz
buf fix
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/colour.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/colour.py b/src/colour.py
index db51bc1..c169456 100644
--- a/src/colour.py
+++ b/src/colour.py
@@ -72,7 +72,7 @@ def matrix_mul_vector(matrix, vector):
@param vector:list<int> The vector
@return :list<int> The resulting vector
'''
- return [[r * v for r, v in zip(row, vector)] for row in matrix]
+ return [sum([r * v for r, v in zip(row, vector)]) for row in matrix]
ciexyz_to_linear_matrix = [[ 3.240450, -1.537140, -0.4985320],
@@ -151,9 +151,9 @@ def ciexyz_to_cielab(x, y, z):
x /= 0.95047
z /= 1.08883
f = lambda c : c ** 1 / 3 if c > 0.00885642 else (7.78 + 703 / 99900) * c + 0.1379310
- l = 116 * f(Y) - 16
- a = 500 * (f(X) - f(Y))
- b = 200 * (f(Y) - f(Z))
+ l = 116 * f(y) - 16
+ a = 500 * (f(x) - f(y))
+ b = 200 * (f(y) - f(z))
return (l, a, b)
@@ -172,7 +172,7 @@ def cielab_to_xiexyz(l, a, b):
f = lambda c : c ** 3 if c ** 3 > 0.00885642 else (c - 0.1379310) / (7.78 + 703 / 99900)
(x, y, z) = [f(c) for c in (x, y, z)]
x *= 0.95047
- y *= 1.08883
+ z *= 1.08883
return (x, y, z)