Color

In color images, we have many different methods to store the underlying information. The most common method, the one that also provides the easiest computational structures for creating algorithms, is the RGB color space. In this method, an image representation contains at least three layers. For each pixel, we assess the combined information of the amounts of red, green, and blue necessary to achieve the desired color and intensity at the corresponding location. The first layer indicates the intensities of underlying reds. The second and third layers indicate, respectively, the intensities of greens and blues:

In [12]: from skimage.data import coffee
In [13]: coffee().shape
Out[13]: (400, 600, 3)
In [14]: coffee()
Out[14]:
array([[[ 21, ...

Get Mastering SciPy now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.