But for saving PGraphics I shall use layer1.saveFrame and layer2.saveFrame, isn't it? I don't want to save all the canvas, I want to save just few selected PGraphics.
so, I don't want to use the canvas, and I'm using more than one additional PGraphics for my drawing layers, and the question is - how to save more than one PGraphics in one file.
I am assuming that all your layer images are the same size. Lets assume that each layer is w x h pixels and you have n layers. To save these as a single file create a new PGraphics object of size w * n x h pixels. Then draw the layers as a series of horizontal tiles on the big graphic and save it.
The reverse process would be to load the large graphic and use get(..) to retrieve the individual tiles.
I want save different PGraphics layers like a photoshop "flatten image" operation, so, if canvas size was 800x600, and my different PGraphics was 800x600, I want my final image to be 800x600.
I am assuming that all your layer images are the same size. Lets assume that each layer is w x h pixels and you have n layers. To save these as a single file create a new PGraphics object of size w x h pixels. Then draw the layers onto the graphic in turn to flatten them then save the flattened image.
Answers
2 image() + 1 saveFrame().
can you post a code example?
But for saving PGraphics I shall use layer1.saveFrame and layer2.saveFrame, isn't it? I don't want to save all the canvas, I want to save just few selected PGraphics.
The canvas is itself a PGraphics. >-)
If you don't wanna use the canvas for the image(), just make another PGraphics for it and save() it.
so, I don't want to use the canvas, and I'm using more than one additional PGraphics for my drawing layers, and the question is - how to save more than one PGraphics in one file.
I've already answered that: make another PGraphics to replace the canvas, then save() it. [-(
I am assuming that all your layer images are the same size. Lets assume that each layer is
w
xh
pixels and you haven
layers. To save these as a single file create a new PGraphics object of sizew * n
xh
pixels. Then draw the layers as a series of horizontal tiles on the big graphic and save it.The reverse process would be to load the large graphic and use get(..) to retrieve the individual tiles.
I want save different PGraphics layers like a photoshop "flatten image" operation, so, if canvas size was 800x600, and my different PGraphics was 800x600, I want my final image to be 800x600.
I am assuming that all your layer images are the same size. Lets assume that each layer is w x h pixels and you have n layers. To save these as a single file create a new PGraphics object of size
w
xh
pixels. Then draw the layers onto the graphic in turn to flatten them then save the flattened image.I will try this, thanks