Advertisement


Help me optimize this Photoshop process (create image from layer)


Question

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.

2011/07/13
1
2
7/13/2011 5:14:00 PM

Accepted Answer

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.)
2011/07/13
2
7/13/2011 6:16:00 PM

  1. Right-click the layer in the layers palette, then click Duplicate Layer....

Duplicate Layer

  1. Under Destination select New. Press OK.

Destination-»New

  1. The new file should be the same dimensions as the original, so in the menu, select Image->Trim

Trim

  1. Depending on the image, select Transparent Pixels, Top Left Pixel Color, or Bottom Right Pixel Color. Click OK.

How to trim

  1. Done!
2017/03/08