How to draw bitmap array in Processing?

Here is how pixels[] works:

The pixels[] array contains the values for all the pixels in the display window. These values are of the color datatype. This array is defined by the size of the display window. For example, if the window is 100 x 100 pixels, there will be 10,000 values and if the window is 200 x 300 pixels, there will be 60,000 values. pixels[] / Reference / Processing.org

Setting the color of a single pixel with set(x, y) is easy, but not as fast as putting the data directly into pixels[] . The equivalent statement to set(x, y, #000000) using pixels[] is pixels[y*width+x] = #000000 . set() / Reference / Processing.org

1 Like