PS 09 - How to Save Selected Layers from a Document

21 January, 2013

At times when you have a huge layers with all kinds of graphics, and saving a selected layer is always a hardest task.

There is a way where you can save only a selected layer content from photoshop. But, there are some limitations for the image format.

For this tutorial, I have created 8 simple boxes with simple graphics which we are going to export. First step we'll separate and save all the boxes. Second, select a few of them and replace only the selected ones.

Before we start let see how the layers are arranged. It is always a good practice to organize your layers.

(fig 1.0)

Based on the layer palette (fig 1.1 - 1), each and every box are in a separate layer.

And since we have two layers (the graphics and its background), we can combine as one with smart object. (fig 1.1 - 2)

(fig 1.1)

If we save this image (fig 1.2), we'll get an output as single image. To separate, we need to crop them individually. or
Since these are converted into smart objects, we can go inside each and every smart object and save them individually.

Right now it might NOT look like time consuming but what if you have more than 8 layers.

What we want is a more flexible way, so later if we need to edit the graphics or change the color, we can able to save only the selected content and not everything.

(fig 1.2)

First step is to tell photoshop to see each and every individual box separately. So when we save this file, it will all be saved as a separated image.

Because each and every box has a even shape, the easiest way to do is to Slice them first and save them with save for web dialog box. Save for Web is not only for Web, you can also use it to save normal images with JPEG, PNG, or GIF format.

Select the Slice Select Tool from the Tool bar (fig 2.0 - 1) and click on the button 'Show Auto Slice' to display the default slice (fig 2.0 - 2). Auto Slice is always be there in any opened image or any new document created inside photoshop. This will act as a base for all the slices.

 You can learn all about how auto slice works >> Essentials for Slice Select Tool I

(fig 2.0)

Now that we have auto slice in our document, lets see which slice type we can use to slice our image.

There are two kind are slices we can use here. One is User based slice and another is a Layer based slice. Because all the boxes in different layers, using a layer based slice is more effective. This will slice the box based on the layer content.
Another option is to use Divide option which will convert auto slice to user based slice automatically.

Learn more about User based slice and Layer based slice >> Essentials for Slice Select Tool II

For this tutorial we'll use Divide options on auto slice.
With the Slice Select Tool selected, select the auto slice in the document and click 'Divide' from the options bar (fig 2.1). Divide option won't work on auto-slice, but it will automatically Promote to User based slice.

Notice the symbol color and the handles around the image once the divide dialog box is opened.

(fig 2.1)

Use 'Divide Horizontally Into' and 'Divide Vertically Into' to add sections. Type the numbers you want to add more slices. Click 'OK'.

Each slice has its own number and these numbers are generated automatically. This will be the file name when you save these slices.

(fig 2.2)

Go to 'File' menu and select 'Save for Web'.

In the Save for web dialog box select the format to 'JPEG' and click 'Save'. You can also select other formats from the drop-down list.

(fig 2.3)

In the 'Save Optimized As' dialog box, select the format as 'Image Only' (because we don't need any html files) and select 'All Slices' as slices option and click 'Save'.

You can learn more about slices for HTML >> Essentials for Slice Select Tool IV

(fig 2.4)

Now we have all the boxes saved individually with JPEG format.

(fig 2.5)

Now lets edit some graphics (fig 3.0). The first set is the original design and the second set is where the graphics are changed.

01 graphics is moved to 04
04 graphics is moved to 06
06 graphics is moved to 01
(just so you can see more clearly i have reduced the transparency for other slices)

Let's save/replace only the edited slices (01, 04, and 06)

(fig 3.0)

Go to 'save for web' dialog box and select (hold 'Crtl' (Cmd in mac) to select multiple slices) only the changed slices (fig 3.1 - 1) and click 'Save'.

From the 'Save Optimized As' dialog box select 'Selected Slices' (fig 3.1 - 2) as slices option and click 'Save'.

'Selected Slice' will save only the slices you have selected inside save for web dialog box. By selecting this option you can avoid saving all the slices again.

(fig 3.1)

This will replaced the images. If you don't want to replace, you can change the location in the 'Save Optimized As' dialog window.

(fig 3.2)

You can see the replaced slices (fig 3.3 - 2).

In the Slice option inside the 'Save Optimized As' dialog box there are three options you can choose from.

All Slices: This will save all the slices including auto slice
All User Slices: This will save all slices (user based slice, layer based slice, and subslice) except auto slice
Selected Slices: This will save only the Selected Slice(s) from 'Save for Web' dialog box. You can also use auto-slice for this option

(fig 3.3)

When working on webpage design, most of the time there are minor corrections happen for images or buttons, and replacing only the changed graphics and not the complete design is always a huge time saver.

No comments:

Post a Comment