I imagine it doesn't matter in this case because none of the values are actually 1, but shouldn't conversion to uint8 be done as `255 * float_image`? Otherwise you might get overflow if any of the values in the float image are 1.0?

```python
In [1]: x = (np.array([1.0]) * 256).astype(np.uint8)

In [2]: x
Out[2]: array([0], dtype=uint8)
```