diff --git a/skimage/data/chessboard_GRAY_U16.tif b/skimage/data/chessboard_GRAY_U16.tif new file mode 100644 index 00000000..13f78ee5 Binary files /dev/null and b/skimage/data/chessboard_GRAY_U16.tif differ diff --git a/skimage/io/tests/test_pil.py b/skimage/io/tests/test_pil.py index 058e1dc9..b01bd42f 100644 --- a/skimage/io/tests/test_pil.py +++ b/skimage/io/tests/test_pil.py @@ -51,6 +51,14 @@ def test_bilevel(): img = imread(os.path.join(data_dir, 'checker_bilevel.png')) assert_array_equal(img, expected) +@skipif(not PIL_available) +def test_imread_uint16(): + expected = np.load(os.path.join(data_dir, 'chessboard_GRAY_U8.npy')) + img = imread(os.path.join(data_dir, 'chessboard_GRAY_U16.tif')) + assert img.dtype == np.uint16 + assert_array_almost_equal(img, expected) + + class TestSave: def roundtrip(self, dtype, x, scaling=1): f = NamedTemporaryFile(suffix='.png')