How to save an image correctly?

How do I correctly save my image to a file?

void setup() {
  size(312, 161);
  //size(624, 712);
  img1 = loadImage("spaceodyssey.jpg");
  img2 = loadImage("spaceodyssey.jpg");
  img1.filter(POSTERIZE, 7.5);
1 Like

you are working with 2 different images without displaying them

  • what you do now: save saves the screen (which is empty)

  • instead say"output1.jpg"); - this tells the img2 to be saved

1 Like

Hello maxrussel
You need to add a
line to display your image on the screen which then gets saved to your output.jpg file.

thank you - how would I save what’s actually displayed in the output frame though? And/or, possibly combine both images?

Hello maxrussell
You can display multiple pictures on your canvas by simply using the image(); method more than once. If you want to edit the pictures before printing them to the canvas you can use methods like tint, saturation etc. There is a detailed description of all Processing methods here: