> This comment does not bear on the output/behaviour. It simply mentions that the block of code below is meant to handle float images and values outside range(256), which is the case (i.e., it is the intention).

Right, I just assumed a different behavior from the comment. Would it be clearer to right something like

> # Limit the number of unique values to 256

A warning is a good idea, but I'm worried that float images will (almost) always raise the warning because of precision.