Another form of image editing or processing has to do with changing the color values of the pixels themselves. Being able to do this allows us the ability to change contrast levels, brightness, overall hue, and so on.
In a way similar to how we use the
Matrix object when drawing on a
Canvas, we can use a
ColorMatrix object to alter the
Paint that is used to draw on a
ColorMatrix works in a similar manner as well. It is an array of numbers that operate on the pixels of the image. Instead of operating on the x, y, and z coordinates, though, it operates on the color values—Red, Green, Blue, and Alpha of each pixel.
We can construct a default
ColorMatrix object by calling its constructor without any arguments. ...