Photoshop: copy a layer from one file to another with python

Viewed 31

I have two psd files, one with the background another with the content. Is it possible to use python to copy the background layer to the other (content) file?

I would like to automate this process with python.

Thank you

1 Answers

Manged to solve this with GIMP scripts. An example:

# read in
content = pdb.gimp_file_load("content.psd", "")
gimp.Display(content)
background = pdb.gimp_file_load("background.psd", "")
gimp.Display(background)

# add image to new background file
new_layer = pdb.gimp_layer_new_from_drawable(content.layers[0], background) # assuming first layer is what we want here.
background.add_layer(new_layer)
Related