Changing an embedded or linked image in a PSD file #585
cbitterfield
started this conversation in
Show and tell
Replies: 1 comment
-
I'm not familiar with Photoshop, but the first frame looks like the composite generated for legacy viewing. Possibly safe to ignore. For swapping a image frame, try targeting the layer's label. Something like... with Image(filename="brandi.psd") as img:
# Rewind the image cursor to the start of the stack.
img.iterator_reset()
# Loop across all layers.
while True:
# Attempt to match layer by "label" attribute.
if 'Brandi' == img.artifacts['label']:
# Overwrite layer.
w, h = img.size # Grab original size for demonstration.
with Image(width=w, height=h, pseudo='plasma:') as new_image:
img.image_set(new_image)
# Move to the next layer, or stop.
if not img.iterator_next():
break |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Looking for some help changing a linked or embedded image in a PSD file.
I put the source files here for reference:
https://github.com/cbitterfield/wand-documentation.git
Steps to Create:
What I get is this:
A screenshot from Photoshop was uploaded.
Clearly, photoshop thinks there are two layers and Wand shows three.
The problem I am trying to solve is replacing the linked or embedded photo programmatically.
Beta Was this translation helpful? Give feedback.
All reactions