How to check the color of pixel and the color of pixels around this first pixel? For example i want to check mouseX and mouseY pixel color, and all the pixels colors which are located on the certain radius from mouseX and mouseY.
You could use color c = get(x,y) to obtain the color at pixel (x,y) or you could do:
PImage cImg=img.get(mouseX-1,mouseY-1,3,3)
to get a section of the image where you could then do the color checking. There are some examples in the video library under capture. Are you familiar with accessing the provided examples of installed libraries?
Answers
Not exactly you're asking for, but this old forum thread got an example of circular image cropping: ~:>
https://forum.Processing.org/two/discussion/5618/crop-image#Item_26
I will read this, thanks
If your image is loaded PImage object, after you display the image you can call loadPixels() and then you can get access to those pixels directly.
https://processing.org/reference/PImage.html
https://processing.org/reference/loadPixels_.html
You could also use the get() function. Check the argument options for this function:
https://processing.org/reference/get_.html
You could use color c = get(x,y) to obtain the color at pixel (x,y) or you could do:
PImage cImg=img.get(mouseX-1,mouseY-1,3,3)
to get a section of the image where you could then do the color checking. There are some examples in the video library under capture. Are you familiar with accessing the provided examples of installed libraries?
Kf