mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-27 18:25:32 +08:00
colorconv: Add rgba2rgb()
rgba2rgb() is a conversion function which takes in a background RGB color which is used to alpha blend with an RGBA image in the foreground. The default value for this background is white (255, 255, 255).
This commit is contained in:
@@ -42,6 +42,17 @@ transformed to floating-point type by the conversion operation::
|
||||
|
||||
|
||||
|
||||
Conversion from RGBA to RGB - Removing alpha channel through alpha blending
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Converting an RGBA image to an RGB image by alpha blending it with a
|
||||
background is realized with :func:`rgba2rgb` ::
|
||||
|
||||
>>> from skimage.color import rgba2rgb
|
||||
>>> from skimage import data
|
||||
>>> img_rgba = data.horse()
|
||||
>>> img_rgb = rgba2rgb(img_rgba)
|
||||
|
||||
Conversion between color and gray values
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user