Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

What's the fastest way to create an image from a layer in Photoshop? The resulting canvas size has to have the same size than the contents of the layer.

Currently I do the following:

  1. Hide all other layers (right click on the eye, Show/Hide all other layers)
  2. Use the magic wand to select the background
  3. Select > Inverse (Shift+Cmd+I) to select the contents of the layer
  4. Copy the selection
  5. File > New (Cmd+N): the dimensions of the new image are those of the selection
  6. Paste the selection
  7. Save

I have to perform this operation many times and I would like to reduce the number of steps to the bare minimum.

share|improve this question
    
Do what you just did, but record it as action, then just call the action. –  Johannes Jul 13 '11 at 19:12
    
Is it possible to execute an action on a specific layer? –  hpique Jul 14 '11 at 8:58
    
Yes I believe the action would run on whatever layer you have selected. –  Johannes Jul 14 '11 at 15:08
add comment

4 Answers

up vote 2 down vote accepted

Sorry, I'm not sure if Cmd is the Mac equivalent of Windows' Ctrl Key but here's how it goes on Windows...

  1. Ctrl + a (Select all)
  2. Ctrl + c (Copy)
  3. Ctrl + n (New Document)
  4. Ctrl + v (Paste)

Your first 3 steps can be condensed into Select AllCopy. Copy command only copies the current selected layer. Copy will also ignore any transparent pixels. For example, if you have a 100 x 100 image which is entirely transparent except for a 10 x 10 square in the center, Select AllCopy will only copy the 10 x 10 square.

If you want to copy a flattened image of currently visible layers, use Ctrl + Shift + C (Copy Merged)

Edit:

  • If you're performing this operation many layers in the same file, try FileScriptsExport layers to files.... As of CS5 (CS4?), you can tell it to Trim Layers when using PNG-24 as the file type.
  • If you're performing this operation on many different files, you may want to consider saving the keystrokes above as an Action. Then you'd only have to open your file, select the desired layer, and run your action. (This should work on any recent version of PS.)
share|improve this answer
    
Ctrl+N will not always give you the dimension of the original psd though(what he's asking), if the copied content layer has transparent padding. –  Jin Jul 13 '11 at 17:52
    
@Jin The question specifies "The resulting canvas size has to have the same size than the contents of the layer" (emphasis added), not of the original psd. –  Farray Jul 13 '11 at 18:02
    
ah sorry I misread. I often run into a simliar situation, but I need the new document to be the same as the original PSD, and the same content position too. –  Jin Jul 13 '11 at 18:06
    
Ctrl on Windows and Cmd on Mac are equivalents. +1 for the simplest and most straightforward answer. Looks like you're a kbsc person, like me. –  Alan Gilbertson Jul 14 '11 at 15:30
add comment
  1. Right-click the layer in the layers palette, then click Duplicate Layer.... Duplicate Layer
  2. Under Destination select New. Press OK. Destination-»New
  3. The new file should be the same dimensions as the original, so in the menu, select Image->Trim Trim
  4. Depending on the image, select Transparent Pixels, Top Left Pixel Color, or Bottom Right Pixel Color. Click OK. How to trim
  5. Done!
share|improve this answer
add comment

try this with any kind of layer,image,shape.

I do follow this for similar layer size output

my document was 1024*700

and i draw a shape, to get the exact shape dimension, do ctrl+click whether its image,shape or anything, than ctrl+c and then ctrl+n it will create new document on the basis of selection then ctrl+v..i attached some SS to make you clear hope this will lead you somewhere......

( left click > view image for clear SS in broswer )


image 1

ctrl+c than ctrl+n


image 2

for any other layer,image do the same


image 3

Hope this will help...

share|improve this answer
add comment

Isn't it silly that there isn't a command for this?

Here's what I usually do. It seems a bit silly but it really is the fastest.

  1. Image>Duplicate Image (I made a keyboard shortcut for this).
  2. Enter. If you want to name it, just type in the name before you hit Enter.
  3. Now just run through layers you don't want with the backspace key. If you have a lot of layers, turn off the ones you want to keep, merge->visible, and backspace.

For some reason, I find this a lot less aggravating than the other possible methods.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.