def _prepare_lab_array(arr):
 arr = np.asarray(arr)
 shape = arr.shape
 if (shape[(-1)] < 3):
  raise ValueError('Input array has less than 3 color channels')
 return dtype.img_as_float(arr, force_copy=True)

def _prepare_lab_array ( arr ) : arr = np . asarray ( arr ) shape = arr . shape if ( shape [ ( - 1 ) ] < 3 ) : raise ValueError ( 'Input array has less than 3 color channels' ) return dtype . img_as_float ( arr , force_copy = True )
ensure input for lab2lch .