Hi Guys,
Is there a way to insert an image into a layer in an existing PSD file with IM? Ie, I have a PSD file with 3 layers, and want to insert a jpg into the last layer, without touching the other layers?
Cheers!
Insert image into PSD layer
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Insert image into PSD layer
Something like this should work. Windows BAT syntax. Adjust for Unix.
This reads all the layers, makes a clone of the last one, composites x.jpg over it, swaps the last two layers, and deletes the last layer.
Code: Select all
convert ^
in.psd ^
( +clone ^
in.jpg ^
-composite ^
) ^
+swap +delete ^
out.psd
snibgo's IM pages: im.snibgo.com
Re: Insert image into PSD layer
Sweet, I'll give that a try tomorrow. Thanks!
Re: Insert image into PSD layer
Unfortunately this doesn't quite work. With a 3 layer PSD, it places the image in.jpg onto to topmost layer, instead of the layer I want. I tried using in.psd[1] and even specify the layer name with -label, but none of that worked.
Even if I got it to work as intended, the purpose of this was to leave the other layers as they are, which isn't happening. I had two layers locked in Photoshop, (see another post of mine asking about locking layers) and was hoping this would be another approach to getting layers to stay locked.
IM takes the original PSD, copies all the layers and creates a new PSD. Unfortunately, it doesn't copy layer properties it doesn't know. Which makes sense I suppose.
Even if I got it to work as intended, the purpose of this was to leave the other layers as they are, which isn't happening. I had two layers locked in Photoshop, (see another post of mine asking about locking layers) and was hoping this would be another approach to getting layers to stay locked.
IM takes the original PSD, copies all the layers and creates a new PSD. Unfortunately, it doesn't copy layer properties it doesn't know. Which makes sense I suppose.
snibgo wrote:Something like this should work. Windows BAT syntax. Adjust for Unix.This reads all the layers, makes a clone of the last one, composites x.jpg over it, swaps the last two layers, and deletes the last layer.Code: Select all
convert ^ in.psd ^ ( +clone ^ in.jpg ^ -composite ^ ) ^ +swap +delete ^ out.psd
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Insert image into PSD layer
About locking, see viewtopic.php?f=1&t=27740.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Insert image into PSD layer
I don't use Photoshop, and don't know what the "topmost" layer is.OlgerD wrote:Unfortunately this doesn't quite work. With a 3 layer PSD, it places the image in.jpg onto to topmost layer, instead of the layer I want.
In IM, we can clone any of the images in the list with "-clone N". Then do any processing on that new layer. Then "-swap N,-1", then "+delete".
snibgo's IM pages: im.snibgo.com
Re: Insert image into PSD layer
Yeah, thats my other post I was referring to.fmw42 wrote:About locking, see viewtopic.php?f=1&t=27740.
Re: Insert image into PSD layer
I'm no Photoshop expert either, but I do have access to it at work.
In Photoshop (and I assume this would be true for any app that can open a PSD file), the topmost layer is the highest layer number. Ie, layer 1 is generally the background and in a 3 layer PSD, layer 3 would be the toplayer.
Unfortunately, IM seems to clone only known properties, if any at all.
In Photoshop (and I assume this would be true for any app that can open a PSD file), the topmost layer is the highest layer number. Ie, layer 1 is generally the background and in a 3 layer PSD, layer 3 would be the toplayer.
Unfortunately, IM seems to clone only known properties, if any at all.
snibgo wrote:I don't use Photoshop, and don't know what the "topmost" layer is.OlgerD wrote:Unfortunately this doesn't quite work. With a 3 layer PSD, it places the image in.jpg onto to topmost layer, instead of the layer I want.
In IM, we can clone any of the images in the list with "-clone N". Then do any processing on that new layer. Then "-swap N,-1", then "+delete".