I see that now, you're right - dtype shouldn't be an issue. Intensity values could be, though, coming from integer types. `img_as_float` converts to range [0, 1] and then later get divided again by `ratio`, but if `sigma=0` then the original range gets cast to float in division and probably has a much greater range.

Maybe this isn't a problem for the algorithm, just pointing it out. It's worth noting that `img_as_float` passes a floating-point input unchanged, even if not on range [0, 1], so that function isn't necessarily a cure-all for input range.