Does it have to be a 2D image? I see nothing in the code that suggests it, in which case the doc could allow 3D images (as I did in the docstring for e.g. `rgb2xyz`) as `(.., ..,[ ..,] 3)`.