We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Does pixels[] actually contain an array of colors? I keep trying to use this:
color currentPX = baseImg.pixels[ xPlace + ( baseImg.width * yPlace ) ];
but it always returns gray.
The image loads in correctly, and I'm using loadPixels();
What could I be doing wrong?
Answers
Before reading pixels[]: loadPixels()
After modifying pixels[]: updatePixels()
What is a
color
data type in P5: https://Processing.org/reference/color_datatype.htmlSorry, found the error, it was separate. I was trying to draw the pixel with
I'm not sure if this even works or if it was interpreting
currentPX
as an int, but i ended up usingThanks though
The color for lines, edges and points is defined with stroke().
But using set() is fine too.