How to save image after edits

edited January 2018 in Questions about Code

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!

Sign In or Register to comment.