Follow us on Twitter!
Follow us on Facebook!
 

Go Back   Pixtus - Photography Forum, Photographers, Photo Tips > Photography Information > Photo Tips


2 Photoshop/layer questions

This is a discussion on 2 Photoshop/layer questions within the Photo Tips forums, part of the Photography Information category; Is there an easy way to import a psd as a new layer into another document and how do different ...

Reply
 
LinkBack Thread Tools Display Modes
  (#1) Old
Forum Master
 
evil4blue's Avatar
 
Posts: 1,915
Join Date: Jul 2005
Location: Azle, TX, Texas
Real First Name: Steven
Camera: Nikon D200
Can Others Edit My Photos: Yes
iTrader Rating: 3

Likes Received LIKES Received: 0
Likes Given LIKES Given: 0
Send a message via AIM to evil4blue
2 Photoshop/layer questions - 01-20-2006, 09:58 AM


Is there an easy way to import a psd as a new layer into another document and how do different canvas sizes effect the import? I'm trying to batch this process but haven't figured out a good way to do this.

Second, in the layers drop down, I see a can align a layer, but I've only ever seen this option grayed-out. What do I have to do to use this bad boy?

Thanks

---------------------------
Steve Almas
Nikon Geek

"You can't deny my Evil4Blueness!"
Reply With Quote
Sponsored Links

Premium Members do not see Google advertisements. SIGN UP today and help support our community.
  (#2) Old
Bit herder
 
Gordon's Avatar
 
Posts: 3,265
Join Date: Jan 2005
Location: Austin, Tx,
Real First Name: Gordon
Camera: Canon
Can Others Edit My Photos: Yes
iTrader Rating: 2

Likes Received LIKES Received: 0
Likes Given LIKES Given: 0
Send a message via Yahoo to Gordon
01-20-2006, 10:11 AM


Yes it is easyish to do.

I wrote a script that would take 9 images and layer them together, with different blend effects (playing around with digital multi-image type stuff)

Different canvas sizes : you'll need to decide what you want to do - resize the canvas/ stretch them/ stick it in one corner - whatever, but you have to decide what you want, then it is pretty easy to do too.

To align layers, you have to have selected a couple of them I think. Don't believe you can do this to the background/ bottom layer, either.

---------------------------
--
ghost town graveyard
Reply With Quote
  (#3) Old
Ray Ray is offline
Forum Master
 
Ray's Avatar
 
Posts: 1,271
Join Date: Jul 2005
Location: H, Texas
Real First Name: Ray
Camera: Nikon
Can Others Edit My Photos: No
iTrader Rating: 0

Likes Received LIKES Received: 0
Likes Given LIKES Given: 0
01-20-2006, 10:12 AM


To align layers, you need to have multiple layers selected.

Last edited by Ray; 01-20-2006 at 10:58 AM..
Reply With Quote
  (#4) Old
Bit herder
 
Gordon's Avatar
 
Posts: 3,265
Join Date: Jan 2005
Location: Austin, Tx,
Real First Name: Gordon
Camera: Canon
Can Others Edit My Photos: Yes
iTrader Rating: 2

Likes Received LIKES Received: 0
Likes Given LIKES Given: 0
Send a message via Yahoo to Gordon
01-20-2006, 10:14 AM


You can see the script that I wrote on my multiimage workshop blogthingy (web 3.14157 & all that )

Smart Lazy

You could use that as a starting point - it is pretty easy to understand and modify.

There is also a rather good pdf book that comes with photoshop that explains all the scripting support. Massively more useful than actions and pretty easy to use. Lives somewhere in your Photoshop install hierarchy - could well be in the root dir, I can't remember. If you search for pdfs it should be pretty obvious which one it is (Scripting Guide.pdf or something similar - I'm at work, don't have access to check)

If want/ need help writing a script, let me know. I don't believe there is an easy way to do what you want to do with actions though.

---------------------------
--
ghost town graveyard
Reply With Quote
  (#5) Old
Uber Poster
 
PeteQ's Avatar
 
Posts: 2,777
Join Date: Sep 2005
Location: Pine Bush, NY, New York
Real First Name: Pete
Camera: Canon
Can Others Edit My Photos: No
iTrader Rating: 3

Likes Received LIKES Received: 0
Likes Given LIKES Given: 2
01-20-2006, 10:15 AM


I don't think you can import a complete PSD, only a layer at a time. At least that's all I have ever been able to get to work. However, you could do a "Save All Visible Layers" to a New Layer (Cmd+Optn+Shift+E) and then place that layer into your target document.


On edit - Wow, see what happens when you take time to type, all this good information floods in!!!

---------------------------
Website: http://www.quinncophoto.com
Twitter: http://twitter.com/petequinn
Reply With Quote
  (#6) Old
Bit herder
 
Gordon's Avatar
 
Posts: 3,265
Join Date: Jan 2005
Location: Austin, Tx,
Real First Name: Gordon
Camera: Canon
Can Others Edit My Photos: Yes
iTrader Rating: 2

Likes Received LIKES Received: 0
Likes Given LIKES Given: 0
Send a message via Yahoo to Gordon
01-20-2006, 10:21 AM


To break this down and show how easy it is, I'll go through the script line by line and comment.

numDocs is a variable and is set to the number of open files in Photoshop - the script as written assumes the docs you want to merge are all open at one time:

var numDocs = documents.length

Go through all of the documents, other than the first one (which is document[0])
The aim is to stack all the other layers on document[0] (so open the base document first when running this script

for (i = 1; i < numDocs ; i++)
{

Switch to the next document (activeDocument is like clicking on it to bring it to the front)
Then copy the background layer - assumes the other documents are single layers - you could also work through each layer individually, or flatten them all first

activeDocument = documents
activeDocument.artLayers["Background"].copy()


Switch back to the first document (document[0] and add a new blank layer, then paste the previously copied layer into that new layer. The opacity is adjusted to decrease the more layers we add - this is the place to fiddle with any layer effects you want to change.

activeDocument = documents[0]
layerRef = documents[0].artLayers.add()
documents[0].paste()
layerRef.opacity = 100/(i+1)
}


The layering is finished, now run through all of the other open documents and close them, leaving just document[0] open, with all the layers in it.

for (i = numDocs-1; i >0 ; i--)
{
documents
.close(SaveOptions.DONOTSAVECHANGES)
}

---------------------------
--
ghost town graveyard

Last edited by Gordon; 01-20-2006 at 10:24 AM..
Reply With Quote
  (#7) Old
Bit herder
 
Gordon's Avatar
 
Posts: 3,265
Join Date: Jan 2005
Location: Austin, Tx,
Real First Name: Gordon
Camera: Canon
Can Others Edit My Photos: Yes
iTrader Rating: 2

Likes Received LIKES Received: 0
Likes Given LIKES Given: 0
Send a message via Yahoo to Gordon
01-20-2006, 10:31 AM


Quote:
Originally Posted by PeteQ
On edit - Wow, see what happens when you take time to type, all this good information floods in!!!
I think learning photoshop scripting was the single biggest boost to my productivity, only slightly behind learning that Masks==Selections==Channels==8 bit images (which is the single most powerful fact in photoshop and seems to be something a whole lot of people don't fully grasp)

---------------------------
--
ghost town graveyard
Reply With Quote
  (#8) Old
Uber Poster
 
PeteQ's Avatar
 
Posts: 2,777
Join Date: Sep 2005
Location: Pine Bush, NY, New York
Real First Name: Pete
Camera: Canon
Can Others Edit My Photos: No
iTrader Rating: 3

Likes Received LIKES Received: 0
Likes Given LIKES Given: 2
01-20-2006, 10:38 AM


Oh, no doubt scripting is fantastic! But it's a long way from my days with Hypercard! And I have no idea what the heck you are talking about in the rest of your post!

Perhaps I understand them individually, but not that there is some voodoo tie-in behind them all....

---------------------------
Website: http://www.quinncophoto.com
Twitter: http://twitter.com/petequinn
Reply With Quote
  (#9) Old
Forum Master
 
evil4blue's Avatar
 
Posts: 1,915
Join Date: Jul 2005
Location: Azle, TX, Texas
Real First Name: Steven
Camera: Nikon D200
Can Others Edit My Photos: Yes
iTrader Rating: 3

Likes Received LIKES Received: 0
Likes Given LIKES Given: 0
Send a message via AIM to evil4blue
01-20-2006, 10:38 AM


Thanks Gordon,

This is very close to what I'm wanting to do. Do you know what the syntax is for opening the same document everytime? This is what I really want to do:

Say I have a file, named my_logo.psd, and the location is known (never changes). The document only has one layer and is small enough to always fit on any other document I want to apply it to (say 50 x 50 px).

I want to open a photo, then run the script that will open the my_logo.psd into my already opened photo as a new layer, then I'd like to align the object (my_logo) in the new layer to the bottom right corner.

I already have a script that does this exact process, but it isn't discrete and gets confused often.

Does any of this make sense?

---------------------------
Steve Almas
Nikon Geek

"You can't deny my Evil4Blueness!"
Reply With Quote
  (#10) Old
Bit herder
 
Gordon's Avatar
 
Posts: 3,265
Join Date: Jan 2005
Location: Austin, Tx,
Real First Name: Gordon
Camera: Canon
Can Others Edit My Photos: Yes
iTrader Rating: 2

Likes Received LIKES Received: 0
Likes Given LIKES Given: 0
Send a message via Yahoo to Gordon
01-20-2006, 10:56 AM


So I'm assuming javascript all the way through - as it is the only one portable between windows and mac out of the 3 supported scripting languages:


var logoDoc = open(File("<whateverthepathis>"+"my_logo.psd"))
You can use app.path to make this relative to the Photoshop install directory

activeDocument = logoDoc
activeDocument.artLayers["Background"].copy()

activeDocument=documents[0]
layerRef = documents[0].artLayers.add()
documents[0].paste()
layerRef.doalignmentstuff
(would need to experiement a bit to get this bit - something along the lines of find x & y dimensions of original image, and x/y size of logo. work out top left co-ordinate that you want to put the logo at (e.g., lower right would be bigX-littleX, bigY-littleY) then you'd want to do something like

layerRef.move((bigX-littleX,bigY-littleY))

or equivalent to offset the logo layer correctly.

---------------------------
--
ghost town graveyard

Last edited by Gordon; 01-20-2006 at 11:11 AM..
Reply With Quote
  (#11) Old
Forum Master
 
evil4blue's Avatar
 
Posts: 1,915
Join Date: Jul 2005
Location: Azle, TX, Texas
Real First Name: Steven
Camera: Nikon D200
Can Others Edit My Photos: Yes
iTrader Rating: 3

Likes Received LIKES Received: 0
Likes Given LIKES Given: 0
Send a message via AIM to evil4blue
01-20-2006, 11:02 AM


Gordon you never cease to amaze. I'm actually pretty proficient in javascript, but I really need to brush-up on all the usuable calls for PS.

Thanks again.

---------------------------
Steve Almas
Nikon Geek

"You can't deny my Evil4Blueness!"
Reply With Quote
  (#12) Old
Bit herder
 
Gordon's Avatar
 
Posts: 3,265
Join Date: Jan 2005
Location: Austin, Tx,
Real First Name: Gordon
Camera: Canon
Can Others Edit My Photos: Yes
iTrader Rating: 2

Likes Received LIKES Received: 0
Likes Given LIKES Given: 0
Send a message via Yahoo to Gordon
01-20-2006, 11:10 AM


Quote:
Originally Posted by PeteQ
Oh, no doubt scripting is fantastic! But it's a long way from my days with Hypercard! And I have no idea what the heck you are talking about in the rest of your post!

Perhaps I understand them individually, but not that there is some voodoo tie-in behind them all....
This is probably off in the weeds for this particular thread but, basically:

A selection is an 'active' version of an 8 bit image
A channel is an 8 bit image
A mask is an 8 bit image

Photoshop lets you simply convert between one , to the other, and back again, with just a couple of clicks. Some examples of the power of this:

Working on a selection, but you need to feather the edges : turn it in to a mask and apply filters to it - gaussian blur, paint it with a brush, sharpen it, use levels on it and by varying the gray point simply change the degree and location of the feather, vary the black/ white point to vary the opacity. Click on it again and it is the active selection.

Or, need to select something complicate - find the channel which best represents the thing in highest contrast, turn that straight in to the mask or selection - instant complex selections - then adjust that with brushes/ filters, or selection tools to fine tune.

Or have a selection and want to use it later, or apply one to one layer and the inverse to another - just have the selection active and add a mask to a layer - instantly that selection becomes the layer mask. Do it to the next layer, then select the mask and hit Ctrl-I (invert 8 bit image) and that mask is inverted.

and so on and so forth. When I grasped that I could filter, paint, adjust levels, transform, etc selections, masks and channels into and between each other, photoshop suddenly becomes a so much more powerful tool for photographic adjustments.

---------------------------
--
ghost town graveyard
Reply With Quote
  (#13) Old
Bit herder
 
Gordon's Avatar
 
Posts: 3,265
Join Date: Jan 2005
Location: Austin, Tx,
Real First Name: Gordon
Camera: Canon
Can Others Edit My Photos: Yes
iTrader Rating: 2

Likes Received LIKES Received: 0
Likes Given LIKES Given: 0
Send a message via Yahoo to Gordon
01-20-2006, 11:11 AM


Quote:
Originally Posted by evil4blue
Gordon you never cease to amaze. I'm actually pretty proficient in javascript, but I really need to brush-up on all the usuable calls for PS.

Thanks again.
http://partners.adobe.com/public/dev...renceGuide.pdf

There is a more general scripting reference with photoshop as well that's a good getting started guide. It is pretty well explained.

---------------------------
--
ghost town graveyard
Reply With Quote
  (#14) Old
Uber Poster
 
PeteQ's Avatar
 
Posts: 2,777
Join Date: Sep 2005
Location: Pine Bush, NY, New York
Real First Name: Pete
Camera: Canon
Can Others Edit My Photos: No
iTrader Rating: 3

Likes Received LIKES Received: 0
Likes Given LIKES Given: 2
01-20-2006, 11:20 AM


Well, since we got Evil what he needed, I'm going to hijack where this is headed...

Ok, I understood most of that, what I am getting hung up on is.... These are 8-bit selections/masks/etc. even if I am working in a 16-bit image environment? I have used the channels to do selections and a few other things, but why the reference to only 8-bit images? Maybe the lightbulb will go on then...

---------------------------
Website: http://www.quinncophoto.com
Twitter: http://twitter.com/petequinn
Reply With Quote
  (#15) Old
Bit herder
 
Gordon's Avatar
 
Posts: 3,265
Join Date: Jan 2005
Location: Austin, Tx,
Real First Name: Gordon
Camera: Canon
Can Others Edit My Photos: Yes
iTrader Rating: 2

Likes Received LIKES Received: 0
Likes Given LIKES Given: 0
Send a message via Yahoo to Gordon
01-20-2006, 11:34 AM


Quote:
Originally Posted by PeteQ
Well, since we got Evil what he needed, I'm going to hijack where this is headed...

Ok, I understood most of that, what I am getting hung up on is.... These are 8-bit selections/masks/etc. even if I am working in a 16-bit image environment? I have used the channels to do selections and a few other things, but why the reference to only 8-bit images? Maybe the lightbulb will go on then...
Well in 16-bit mode, they are probably 16-bit greyscale - I wasn't really making a big distinction about that.

But at least at first I hadn't twigged that a selection was an 'active' version of a multi-bit image - i.e., it has lots of levels of selection, just like the mask does.

Maybe I'd be better saying the lightbulb was realising that they are all just greyscale images and can be manipulated, filtered and adjusted as such.

It is pretty cool to watch the feather on a selection being moved dynamically by the greyscale slider on a levels adjustment - you can fade and control the degree of feather much more easily than with any other method - black and white point set the bounds of the feather, grey slider moves the center point.

Also, the idea that you can take a particular channel of the image and turn it straight in to a selection I find incredibly useful for photographic images

For an example of masking from channels

Maybe everyone else already knows all this, but it took me about 8 years to really click on how useful and fundamental it is [I'm a slow learner apparently] - I hardly ever make selections or masks from scratch, or with the wands/ lassos or any of the other rather primative selection tools.

I typically use a channel as a starting point, manipulate it with levels and then paint on it with a brush to finish it off - accurate and quick selections without pain.

---------------------------
--
ghost town graveyard

Last edited by Gordon; 01-20-2006 at 11:36 AM..
Reply With Quote
Reply

Tags
photoshop or layer, questions

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Visit Our Sponsors
 

Google Sponsors

Premium Members do not see Google advertisements. SIGN UP today and help support our community.

Copyright ©2004 - 2011, Abel Longoria - www.Pixtus.com
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.