diff --git a/skimage/novice/_novice.py b/skimage/novice/_novice.py index cac72ee2..24c2ff0e 100644 --- a/skimage/novice/_novice.py +++ b/skimage/novice/_novice.py @@ -281,6 +281,7 @@ class Picture(object): if isinstance(color, six.string_types): color = color_dict[color] rgb_size = tuple(size) + (len(color),) + color = np.array(color, dtype=np.uint8) array = np.ones(rgb_size, dtype=np.uint8) * color # Force RGBA internally (use max alpha) diff --git a/skimage/novice/tests/test_novice.py b/skimage/novice/tests/test_novice.py index e2aafef0..36f4a537 100644 --- a/skimage/novice/tests/test_novice.py +++ b/skimage/novice/tests/test_novice.py @@ -86,6 +86,8 @@ def test_pixel_rgb(): pixel.rgb = np.arange(4) assert_equal(pixel.rgb, np.arange(3)) + assert pic.array.dtype == np.uint8 + def test_pixel_rgba(): pic = novice.Picture.from_size((3, 3), color=(10, 10, 10))