We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello! I want to copy an ellipse of pixels from an image or Capture event to my processing sketch. the copy() function only allows for rectangles and the get() function only copies a single pixel value. Is there a way to do this?
Answers
Look into using
mask()
.https://Forum.Processing.org/two/discussion/5618/crop-image#Item_26
For a mask()-based example, see:
https://forum.processing.org/two/discussion/comment/77997/#Comment_77997
You would use
ellipse()
instead oftriangle()
-- or draw any mask shape you want, really.I was hoping to actually copy the pixels from the image to the ellipse at location mouseX, mouseY and use it sort of as a paintbrush. This is a good start though, thank you so much!
In the linked example, change:
To:
...paintbrush. Big, awkward paintbrush.
You may want to use
imageMode(CENTER)
in setup.Yes! thank you jeremydouglass!