We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, forum So I am doing this image processing application, but I haven't found a way to 'undo' changes or to save changes. I get how changing the brightness or the RBG values changes the image.
loadPixels();
for (int y = 0; y <pic.height; y++) {
for (int x = 0; x <pic.width; x ++) {
int index = x + height*y;
float r = red(pic.pixels[index]);
float g = green(pic.pixels[index]);
float b = blue(pic.pixels[index]);
pixels[index] = color(r, g, b);
}
}
updatePixels();
saveFrame() saves the entire screen, including my user interface. And that's not what I want. I only want the image portion to be saved.
I think PImage.save is the way to go. But I don't know how to save changes to an image object and then it can save.
How do you save store changes so you can go back if you make a mistake?
My code can be found on my Github https://github.com/Finaros/Pixcell Thank you very much!
Answers
https://Forum.Processing.org/two/discussion/15473/readme-how-to-format-code-and-text
https://Processing.org/reference/PImage_save_.html
Thanks! I didn't know how to format text!
If you wanna keep the original PImage, you can clone it via its get() method: :-bd
https://Processing.org/reference/PImage_get_.html
Thanks GoToLoop!