Learn creative coding writing simple programs

89. Create your own photo filters

In the previous episode we used the pixels array for the first time. We wrote random shades of gray to every pixel. The result was an animation that looked like an analog TV that lost the signal.
This time, instead of replacing every single pixel with random values, we read the red, green and blue values of each pixel, and then modify those values. By doing this we can tint the image or convert it into a black and white image.

Tags: pixels, filter, channel

Code editor

You can make changes to the code below. Then

Questions and comments

Try to stay close to the topic of this episode. Use the Processing forums for help with unrelated Processing projects (or hire me for help ;-)

To indicate that a word in your comment is code, use the `backtick`. Example
Do `float` and `int` smell similar?
To highlight code blocks, surround it with ``` code-fences ``` like this:
``` void setup() { size(600, 600); } ```