Chapter 4. Working with Color Images

Up to now, we have only worked with grayscale images. Even in the few cases where our photographs were in color, we first transformed them to grayscale and then processed them. However, color image processing is a much more frequent task in everyday life. It is not that different to what we have already covered; the basic thing we have to remember is that instead of two-dimensional matrices, we have to deal with three-dimensional matrices. In this chapter, we will introduce the concept of color, and expand the techniques covered so far to color images. Many of the image processing methods presented in previous chapters will be revisited, while covering specialized color image processing techniques. All these methods will be analyzed using practical examples of color image enhancement and artistic color manipulation.

In this chapter, we will cover:

  • Some basic knowledge of color image processing and its differences from grayscale image processing
  • How to manipulate and/or threshold the pixel values in color images
  • How to perform color masking
  • What color spaces are and why they are important
  • To use color spaces other than RGB
  • To achieve color isolation in images
  • How to perform red eye reduction

So, let's dive right in!