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:
AbdealiJK
2016-07-06 22:55:51 +05:30
parent f7a0ee8ea4
commit fc2089af32
5 changed files with 99 additions and 0 deletions
@@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~