How can I save a frame of the sketch as .png file, in p5.js?

I need to save .png files of my sketch.

I tried this option

function keyPressed(b) {
   saveFrames('7Lines_', 'png', 3, 30);
}

But it saves as a document file. Does anyone knows what I'm doing wrong?

Screen Shot 2016-11-23 at 15.14.20

Thanks

Tagged:

Answers

  • edited November 2016 Answer ✓

    The way you are using saveFrames() doesn't look like the reference example:

    saveFrames("out", "png", 1, 25, function(data){
      print(data);
    });
    

    If you aren't using a callback, are you getting popup save dialogs? are you choosing a filename in each of those dialogs?

    Edit -- I see, conversation should continue if needed on this thread

  • (That other thread is closed and links here - figured it best to go with the newest thread, the latest bug, with the necessary tidying up)

Sign In or Register to comment.