Tải bản đầy đủ (.pdf) (9 trang)

Tài iệu Photoshop cs5 by Dayley part 129 docx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (333.67 KB, 9 trang )

Part IX: Advanced Output Techniques
956
Using Scripting to Speed Up Workflow
Another great way to save time and increase your productivity when editing images is to utilize
the scripting capabilities in Photoshop. Two main types of scripts are available in Photoshop: the
predefined scripts and the event-driven scripts. Predefined scripts are run once by selecting them
from the File ➪ Scripts menu shown in Figure 31.4. Event-driven scripts are triggered and executed
by events in your normal editing workflow. The following sections discuss utilization of each of
these types of scripts.
FIGURE 31.4
The File ➪ Scripts menu in Photoshop provides several predefined scripts that perform tasks that speed up
your workflow.
Using Photoshop’s scripts
Predefined scripts are similar to other commands in Photoshop with the exception that they
typically perform more than just one task on a single item. The predefined scripts are JavaScript or
AppleScript scripts that perform a series of Photoshop tasks to reduce the number of keystrokes
and mouse clicks you need to make. The following is a list that describes the predefined scripts
available from the File ➪ Scripts menu:
43_584743-ch31.indd 95643_584743-ch31.indd 956 5/3/10 10:54 AM5/3/10 10:54 AM
Chapter 31: Digital Workflow and Automation
957
l
Image Processor: Launches a dialog box that allows you to process a set of files including
converting format, changing names, and running actions.
Cross-Ref
The best place to use the Image Processor is from Bridge while you are managing your files. Using the Image
Processor utility from Bridge is covered in Chapter 6. You can refer to that chapter for information necessary
to use the Image Processor utility to convert and process images. n
l
Delete All Empty Layers: Removes empty layers from the image. This can be a useful
tool to clean up an image when you have used lots of layers when editing.


l
Flatten All Layer Effects: Flattens all the effects that apply to the currently selected layer
in the Layer panel. This rasterizes all the layer effects so you can apply additional filters or
other tools that require the layer to be flattened.
l
Flatten All Masks: Applies the layer masks in all layers. The layer masks affect only the
layer to which they are linked.
l
Simplify Layers for FXG: Simplifies layer settings so that they are compatible with
Adobe’s FXG file format. FXG is an XML-based file format that is used in graphics for
Web applications which are created by applications such as Adobe Flash or Flex 4.
l
Layer Comps to Files: Opens a dialog box, similar to the one in Figure 31.5, that allows
you to specify a file type and location using the following options:
FIGURE 31.5
The Layer Comps to Files script utility can be used to convert the Layer Comps in the
current document into individual files.
43_584743-ch31.indd 95743_584743-ch31.indd 957 5/3/10 10:54 AM5/3/10 10:54 AM
Part IX: Advanced Output Techniques
958
l
Destination: Specifies the location on disk to create the files.
l
File Name Prefix: Specifies the name prefix that is applied to the saved files. The rest
of the filename includes a numerical index and the file extension specified in the File
Type option.
l
Selected Layer Comps Only: Allows only the currently selected Layer Comps in the
image to be saved as individual image files in the specified location. Otherwise, all
Layer Comps are saved as individual files.

l
File Type: Specifies the file format to use when saving the image. You can select BMP,
JPEG, PDF, PSD, Targa, TIFF, PNG-8, or PNG-24.
l
Include ICC Profile: Specifies whether to include the current ICC color profile with
the saved images. It is always a good idea to include a color profile when saving
images.
l
Layer Comps to WPG: Converts the Layer Comps in the image into individual WPG files.
l
Export Layers to Files: Opens a dialog box, similar to the one in Figure 31.5, except that
instead of only saving Layer Comps, all layers are saved to files.
l
Script Events Manager: Allows you to attach specific actions to workflow events in
Photoshop. The Script Events Manager is discussed in much more detail in the next section.
l
Load Files into Stack: Opens the Load Layers dialog box, shown in Figure 31.6, that
allows you to combine a set of files into a stack. A stack is a set of image files taken of the
same subject from the same camera position. Image stacks loaded as layers can be converted
to Smart object and then processed using the options located in the Layers ➪ Smart
Objects ➪ Stack Mode options discussed later in this section.
FIGURE 31.6
The Load Files into Stack script utility provides a simple dialog box that allows you to
select files and define how the individual files are added to a newly created stacked
document.
43_584743-ch31.indd 95843_584743-ch31.indd 958 5/3/10 10:54 AM5/3/10 10:54 AM
Chapter 31: Digital Workflow and Automation
959
From the Load Layers dialog box, you can configure the following options:
l

Use: This allows you to specify whether to use files or a folder as the source for the set
of files. The Browse, Remove, and Add Open Files buttons allow you to add files and
remove files and folders from the Use list.
l
Attempt to Automatically Align Source Images: When this option is selected,
Photoshop tries to find common edges in the images and automatically adjusts the
rotation and position so the images are as closely aligned as possible. Aligning the
images is important for the stack mode algorithms to work well.
l
Create Smart Object after Loading Layers: The stack mode algorithms are based on
processing a smart object. Selecting this option automatically creates a smart object
from all the images. If this option is not selected, the images are loaded as individual
layers that you can edit before combining them into a smart object.
Cross-Ref
Another great place to create image stacks is from Bridge while you are managing your files. Using the Bridge
application to stack images is covered in Chapter 6. You can refer to that chapter for information necessary to
stack and unstack images. n
l
Load Multiple DICOM Files: This opens a dialog box that allows you to select a folder
containing a set of DICOM image files. The DICOM files in the folder are added as
individual layers to a new document in Photoshop.
l
Statistics: This opens the Image Statistics dialog box, shown in Figure 31.7. This dialog
box is similar to the Load Files into Stack option, except that it automatically converts the
images into a single smart object and then applies the stack mode specified in the Choose
Stack Mode option. Statistics is a better option than Load Files into Stack if you do not
want to align the images manually, or if you don’t want to edit any of the layers before
applying the stack mode to the set.
Using stack modes on multiple images
to analyze images and reduce noise

Photoshop provides several options for processing images that have been stacked into a smart
object using the Load Files into Stack script described in the previous section. These stack modes
options can analyze the differences between images and combine images to reduce noise. The
following stack mode options can be found in the Layers ➪ Smart Objects ➪ Stack Mode menu:
l
Entropy: Calculated based on the number of bits that would be necessary to encode the data
from all images in a set. Areas of the image that are different show up white in the resulting
image, and areas with little difference show up as black. This is a great option for locating
missing items between one image and another or embedding hidden copyright notices.
Figure 31.8 shows an example of using the Entropy stack mode to analyze two digital
images. Notice that they both look exactly the same, but when the Entropy mode is
employed a clear copyright notice is shown. The copyright notice was added by creating
text selection mask, as discussed in Chapter 18, copying it to a new layer and then slightly
adjusting the position. You can’t see the change because it is in a busy area of the image.
43_584743-ch31.indd 95943_584743-ch31.indd 959 5/3/10 10:54 AM5/3/10 10:54 AM
Part IX: Advanced Output Techniques
960
FIGURE 31.7
The Image Statistics dialog box allows you to set the stack mode that is applied after
some files are automatically converted into a single smart object.
FIGURE 31.8
Using the Entropy mode, you can quickly compare a digital image with the original to
reveal an embedded copyright message.
Entropy stack mode
Copyrighted
Original
43_584743-ch31.indd 96043_584743-ch31.indd 960 5/3/10 10:54 AM5/3/10 10:54 AM
Chapter 31: Digital Workflow and Automation
961
l

Kurtosis: Calculates the stacked image based on peakedness or flatness of the levels in the
image. Areas that match a normal distribution of levels appear lighter while areas that are
flat or overpeaked appear as darker.
l
Maximum: Uses the maximum channel value for all non-transparent pixels in the stacked
image. This is good for stacks of images where you want to lighten the overall image.
Tip
For the best results, images that you intend to edit using the stack mode options should be taken from a fixed
position such as a tripod with a stationary subject. At the very least, the images must be similar enough that
you can align them together in the set. n
l
Mean: Averages the pixels for all images in the stack and uses the average value for the stacked
image. This is usually the best option for noise reduction if the images are very similar.
l
Median: Takes the middle value for all images in the stack and uses that value for the
stacked image. This option works better than mean for noise reduction if there is a lot of
variance in the lighting and color of the images, such as scratches or dark areas.
Figure 31.9 shows an example of how the median mode can be used to remove unwanted
items. Notice that the three images of the moon have a silhouette of a bird in front, so
none of them are a clean shot. The bird can be removed by stacking the three images and
applying the median mode as shown in the results.
l
Minimum: Uses the minimum channel value for all non-transparent pixels in the stacked
image. This is good for stacks of images where you want to darken the overall image.
l
Range: Calculates the pixel value in the stacked image based on the maximum pixel value
minus the minimum pixel value. This shows the range of variance in the stacked images.
FIGURE 31.9
Using the Median mode, three images of the moon with a silhouette in front can be
processed into a single clean image.

++ =
l
Skewness: Calculates the pixel value based on the variance of the pixels away from the
average. This shows how close the pixel values are to each other.
l
Standard Deviation: Calculates the stacked image values based on the standard deviation
from the mean or square root of the variance. This can help you analyze areas of the
images that are different because the areas that are different show up as a lighter value
based on the amount of variance while areas that are the same across all stacked images
are black.
43_584743-ch31.indd 96143_584743-ch31.indd 961 5/3/10 10:54 AM5/3/10 10:54 AM
Part IX: Advanced Output Techniques
962
l
Summation: Calculates the pixel values in the stacked image by adding values from all
images in the stack. This increases the resolution in fainter areas of the images, but the
brighter areas just become white.
l
Variance: Similar to the Standard deviation. Areas that match are black, and areas that do
not match are gray to white based on the variance in the stacked image.
Use the following steps to apply a stack mode to a series of photographs:
1. Select File ➪ Scripts ➪ Load Files into Stack from the main menu.
2. Add the files you want to apply to the stack as described earlier.
3. Select the Attempt to Automatically Align Source Images option.
This option tries to align the images so that they match up correctly.
Note
You may need to manually align the images in the smart object if the auto alignment option fails to align them
completely. To align the images manually, double-click the smart object layer to open the smart object. The images
are in separate layers, and you can use the Move tool to move the image in each layer until they are aligned. n
4. Select the Create Smart Layer after Loading Layers option. This converts the image

layers into a single smart object.
5. Click the OK button and the images are processed into a single document in
Photoshop with a smart object layer.
6. Select the newly created smart object layer.
7. Use the Layers ➪ Smart Objects ➪ Stack Mode menu and select the stack mode that
you want to apply to the image.
The resulting image in the document window is changed to the results of the stack mode.
Scripting workflow events
Photoshop provides the Script Events Manager, shown in Figure 31.10, that gives you access to
certain program events that occur during normal editing workflow. The Script Events Manager lets
you attach scripts or actions to these events so that each time an event occurs during your editing
workflow, the action/script is run.
Scripting workflow events can be a big timesaver by automatically performing actions you want to
happen without needing to remember them. For example, you can configure the open file event to
automatically save a JPEG copy so that each time you start editing a file, you have a JPEG backup.
The Script Events Manager utility is loaded by selecting File ➪ Script ➪ Script Events Manager from
the main menu in Photoshop. The Script Events Manager allows you to use the following options
to assign actions/scripts to workflow events:
l
Enable Events to Run Scripts/Actions: When this option is selected, the associations in
the scripted events list are active when you are working in Photoshop. When this option is
deselected, the events are ignored and no action or script is run.
43_584743-ch31.indd 96243_584743-ch31.indd 962 5/3/10 10:54 AM5/3/10 10:54 AM
Chapter 31: Digital Workflow and Automation
963
l
Scripted Events List: This lists the current associations between events and actions/
scripts. The Add button adds the association defined by the Photoshop Event, Script,
and Action settings to this list. The Remove and Remove All buttons are used to remove
associations from the list.

l
Photoshop Event: This displays a set of Photoshop events that you will encounter during
the normal workflow including Start Application, New Document, Open Document, Save
Document, Close Document, Print Document, Export Document, and Everything (all
available events).
l
Script: This specifies a script that should be associated with an event and should be run
each time the event occurs. The drop-down list displays the available scripts. The default
script options are fairly limited; however, the drop-down list also provides a browse
option so you can select a JavaScript or AppleScript from the file system.
l
Action: This specifies an action that should be associated with an event and should be run
each time the event occurs. The first drop-down list allows you to select the action set
from the available action sets defined in the Actions panel. The second drop-down list
allows you to select the action from the available actions defined in the Actions panel.
Because you can easily create custom actions using the Actions panel, you have lots of
options when associating actions with events.
Cross-Ref
Creating custom actions is covered in Chapter 5. You can refer to that chapter for information necessary to
build the actions and action sets that can be associated with workflow events. n
FIGURE 31.10
The Script Events Manager allows you to associate an action or a script to normal workflow events so that
each time an event occurs, the action is performed or the script is run.
43_584743-ch31.indd 96343_584743-ch31.indd 963 5/3/10 10:54 AM5/3/10 10:54 AM
Part IX: Advanced Output Techniques
964
Tip
For the best results, images that you intend to edit using the Stack Mode options should be taken from a fixed
position such as a tripod with a stationary subject. At the very least, the images need to be similar enough that
you can align them together in the set. n

Summary
This chapter discussed utilizing Photoshop’s automation and scripting tools to make things easier
and speed up image editing. Photoshop provides the Batch and Droplet tools that allow you to
perform the same set of commands on a set of files without opening each file individually.
Photoshop also provides several scripts that apply a set of repetitive operations, such as flattening
layer masks using a single menu option. In addition to the scripts, Photoshop provides the Script
Events Manager that allows you to associate actions and scripts to normal workflow events. Each
time an event occurs during your workflow, the associated action is performed.
In this chapter, you learned the following:
l
How to use custom actions to process a set of image files all at once.
l
When you create a droplet, Photoshop performs a predefined action on each file that is
dragged and dropped onto it.
l
Photoshop provides several scripts that allow you to perform repetitive actions.
l
Using the Statistics scripts, you can load a series of photos into a stack and then automatically
process the set of files to clean up noise in a way that is not possible with a single file.
l
Normal workflow events such as opening or saving a file can be tied to actions such that
the action is automatically applied when the event occurs.
43_584743-ch31.indd 96443_584743-ch31.indd 964 5/3/10 10:54 AM5/3/10 10:54 AM

×