用法:
skimage.color.rgba2rgb(rgba, background=(1, 1, 1), *, channel_axis=- 1)
使用 Alpha 混合 [1] 進行 RGBA 到 RGB 轉換。
- rgba:(..., 4, ...) 數組
RGBA 格式的圖像。默認情況下,最終維度表示通道。
- background:array_like
與圖像混合的背景顏色(0 到 1 之間的 3 個浮點數 - 背景的 RGB 值)。
- channel_axis:int 可選
該參數指示數組的哪個軸對應於通道。
- out:(..., 3, ...)
RGB 格式的圖像。與輸入相同的尺寸。
- ValueError
如果 rgba 不是至少 2D 的形狀 (..., 4, ...)。
參數:
返回:
拋出:
參考:
例子:
>>> from skimage import color >>> from skimage import data >>> img_rgba = data.logo() >>> img_rgb = color.rgba2rgb(img_rgba)
相關用法
- Python skimage.color.rgb2rgbcie用法及代碼示例
- Python skimage.color.rgb2xyz用法及代碼示例
- Python skimage.color.rgb2gray用法及代碼示例
- Python skimage.color.rgb2hsv用法及代碼示例
- Python skimage.color.rgbcie2rgb用法及代碼示例
- Python skimage.color.rgb2hed用法及代碼示例
- Python skimage.color.lab2lch用法及代碼示例
- Python skimage.color.convert_colorspace用法及代碼示例
- Python skimage.color.combine_stains用法及代碼示例
- Python skimage.color.xyz2rgb用法及代碼示例
- Python skimage.color.separate_stains用法及代碼示例
- Python skimage.color.hsv2rgb用法及代碼示例
- Python skimage.color.lch2lab用法及代碼示例
- Python skimage.color.xyz2lab用法及代碼示例
- Python skimage.color.hed2rgb用法及代碼示例
- Python skimage.feature.graycomatrix用法及代碼示例
- Python skimage.draw.random_shapes用法及代碼示例
- Python skimage.feature.blob_doh用法及代碼示例
- Python skimage.feature.blob_dog用法及代碼示例
- Python skimage.filters.unsharp_mask用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.color.rgba2rgb。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。