Created
February 24, 2024 23:16
-
-
Save yikuansun/b3dc1345eac5c717d5b07f55dadddb76 to your computer and use it in GitHub Desktop.
Add image to document synchronously in Photopea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let currentDocument = app.activeDocument; | |
/* | |
load in the image as an array buffer - will open in new document | |
*/ | |
app.activeDocument.activeLayer.copy(true); | |
app.activeDocument.close(); | |
app.activeDocument = currentDocument; | |
let newLayer = currentDocument.layers.add(); | |
currentDocument.paste(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment