bundles / skimage 0.26.1rc0.dev0 / skimage / color / colorconv / rgba2rgb
function
skimage.color.colorconv:rgba2rgb
source: /_skimage2/color/colorconv.py:185
Signature
def rgba2rgb(rgba, background = (1, 1, 1), *, channel_axis = -1)Summary
RGBA to RGB conversion using alpha blending [1].
Parameters
rgba: (..., C=4, ...) array_likeThe image in RGBA format. By default, the final dimension denotes channels.
background: array_likeThe color of the background to blend the image with (3 floats between 0 to 1 - the RGB value of the background).
channel_axis: int, optionalThis parameter indicates which axis of the array corresponds to channels.
Returns
out: (..., C=3, ...) ndarrayThe image in RGB format. Same dimensions as input.
Raises
: ValueErrorIf
rgbais not at least 2D with shape (..., 4, ...).
Examples
from skimage import color from skimage import data img_rgba = data.logo() img_rgb = color.rgba2rgb(img_rgba)✓
Aliases
skimage.color.rgba2rgb