diff --git a/skimage/novice/_novice.py b/skimage/novice/_novice.py index 843afed4..6f0cb5de 100644 --- a/skimage/novice/_novice.py +++ b/skimage/novice/_novice.py @@ -149,18 +149,22 @@ class Pixel(object): if len(value) == 4: self.rgba = value else: - self._red, self._green, self._blue = (self._validate(v) for v in value) + self._red, self._green, self._blue \ + = (self._validate(v) for v in value) self._alpha = 255 self._setpixel() @property def rgba(self): - """The RGB color and transparency components of the pixel (4 values 0-255).""" + """The RGB color and transparency components of the pixel + (4 values 0-255). + """ return (self.red, self.green, self.blue, self.alpha) @rgba.setter def rgba(self, value): - self._red, self._green, self._blue, self._alpha = (self._validate(v) for v in value) + self._red, self._green, self._blue, self._alpha \ + = (self._validate(v) for v in value) self._setpixel() def _validate(self, value): @@ -270,8 +274,8 @@ class Picture(object): size : tuple Width and height of the picture in pixels. color : tuple or str - RGB or RGBA tuple with the fill color for the picture [0-255] or a valid - key in `color_dict`. + RGB or RGBA tuple with the fill color for the picture [0-255] or + a valid key in `color_dict`. """ if isinstance(color, six.string_types): color = color_dict[color] diff --git a/skimage/novice/tests/test_novice.py b/skimage/novice/tests/test_novice.py index 78193bf5..a1f750ab 100644 --- a/skimage/novice/tests/test_novice.py +++ b/skimage/novice/tests/test_novice.py @@ -13,6 +13,10 @@ IMAGE_PATH = os.path.join(data_dir, "chelsea.png") SMALL_IMAGE_PATH = os.path.join(data_dir, "block.png") +def _array_2d_to_RGBA(array): + return np.tile(array[:, :, np.newaxis], (1, 1, 4)) + + def _array_2d_to_RGBA(array): return np.tile(array[:, :, np.newaxis], (1, 1, 4))