scikit-image/scikit-image — pull request #1189 by blink1073 (2014-10-04 15:33:40+00:00)
Title: Fix PIL plugin for Integer Image Types

The previous behavior was as such:

```python
In [5]: %paste
In [5]: io.imsave('io3.png', np.array([[0, 1], [0, 4196]], dtype=np.uint16), plugin='imread')

In [6]: im = io.imread('io3.png', plugin='pil')

In [7]: im
## -- End pasted text --
Out[5]:
array([[ 0, 1],
[ 0, 4196]])
```

By using `img_as_ubtye`, we get the following behavior:

```python
In [2]: %paste
In [5]: io.imsave('io3.png', np.array([[0, 250], [0, 4196]], dtype=np.uint16), plugin='pil')

In [6]: im = io.imread('io3.png', plugin='pil')

In [7]: im
## -- End pasted text --
skimage\util\dtype.py:107: UserWarning: Possible precision loss when converting from uint16 to uint8
"%s to %s" % (dtypeobj_in, dtypeobj))
Out[2]:
array([[ 0, 0],
[ 0, 16]], dtype=uint8)
```