Speed up _convert

This commit is contained in:
Alex Izvorski
2016-05-01 13:53:30 -07:00
parent a2d4b3cb62
commit c9e8356cf6
+1 -7
View File
@@ -502,14 +502,8 @@ def _convert(matrix, arr):
The converted array.
"""
arr = _prepare_colorarray(arr)
arr = np.swapaxes(arr, 0, -1)
oldshape = arr.shape
arr = np.reshape(arr, (3, -1))
out = np.dot(matrix, arr)
out.shape = oldshape
out = np.swapaxes(out, -1, 0)
return np.ascontiguousarray(out)
return np.dot(arr, matrix.T.copy())
def xyz2rgb(xyz):