bundles / skimage latest / skimage / draw / draw / set_color
function
skimage.draw.draw:set_color
source: /dev/scikit-image/src/skimage/draw/draw.py:295
Signature
def set_color(image, coords, color, alpha = 1)Summary
Set pixel color in the image at the given coordinates.
Extended Summary
Note that this function modifies the color of the image in-place. Coordinates that exceed the shape of the image will be ignored.
Parameters
image: ndarray of shape (M, N, C)Image
coords: tuple of (ndarray of shape (K,), ...)Row and column coordinates of pixels to be colored.
color: ndarray of shape (C,)Color to be assigned to coordinates in the image.
alpha: np.number or ndarray of dtype np.number and shape (K,)Alpha values used to blend color with image. 0 is transparent, 1 is opaque.
Examples
from skimage.draw import line, set_color img = np.zeros((10, 10), dtype=np.uint8) rr, cc = line(1, 1, 20, 20) set_color(img, (rr, cc), 1) img✓
Aliases
skimage.draw.set_color