Image Processing

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 Canvas.

The 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. ...

Get Pro Android Media: Developing Graphics, Music, Video, and Rich Media Apps for Smartphones and Tablets now with the O’Reilly learning platform.

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