PImage.save() not working?

edited May 2016 in Questions about Code

Hi,

I'm trying to save a PImage and I'm getting the famous "PImage.save() requires an absolute path...". The PImage.save() code reference doesn't work either.

size(100, 100);
PImage tower = loadImage("tower.jpg");
PImage newImage = createImage(100, 100, RGB);
newImage = tower.get();
newImage.save("outputImage.jpg");

Any idea? It should work. I'm working with the last version, and Mac OSX.

thanks!

Tagged:

Answers

  • edited May 2016

    I know it works with

    newImage.save(dataPath("") + "/outputImage.jpg");

    but there is a mistake in the PImage.save() web code reference. It seems the example is not working.

    Best.

  • PImage tower = loadImage("tower.jpg");
    PImage biggerTower = tower.get();
    biggerTower.resize(tower.width + 100, tower.height + 100);
    biggerTower.save(dataPath("biggerTower"));
    exit();
    
  • Thanks! But, I'm saying, the example

    https://processing.org/reference/PImage_save_.html

    doesn't work. Don't know if there is an "official" place to notify that kind of things.

  • is this just the standard processing you're using or one of the modes? (p5.js, python...)

    it might just be that you're using immediate mode. put all your code in a setup() method.

  • Answer ✓

    It might just be that you're using immediate mode.

    My own example is immediate mode and save() works flawlessly under it! [-(

Sign In or Register to comment.