From c9e8356cf6458e6a6316fd014fdc55ad3251aadb Mon Sep 17 00:00:00 2001 From: Alex Izvorski Date: Sun, 1 May 2016 13:53:30 -0700 Subject: [PATCH] Speed up _convert --- skimage/color/colorconv.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/skimage/color/colorconv.py b/skimage/color/colorconv.py index 8f2b82c0..93961c49 100644 --- a/skimage/color/colorconv.py +++ b/skimage/color/colorconv.py @@ -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):