This check is actually asserting "Both images should have the same number of dimensions," not specifying 1 or 3. I recommend changing to `shape1 == shape2` if both images must have equivalent shape, otherwise omitting this check and changing the API (see below).

Channels are generally stored in the third dimension when present, but often grayscale images omit the 'channels' dimension so it's difficult to distinguish automatically between a very small/thin image and one which is supposedly RGB. For example, a 2D image would usually be of shape `(M, N)`, not `(M, N, 1)`; in contrast an RGB image would usually be of shape `(M, N, 3)`. Thus, we usually ask the user to tell us if an image is multichannel or not.

`skimage.segmentation.slic` shows our current consensus API, I believe: a boolean `multichannel=` kwarg switches between code paths.