Figure A-47: Click the Make button to display this dialog box, which lets you name your filter, assign it to a submenu, and select the slider bars that you want to appear in the final di
Trang 1Chapter A ✦ Constructing Homemade Effects
Figure A-45: The top row shows three different applications of
the Rotator filter with the Red, Green, and Blue slider bars set to
various positions The Distorto option was set to 0 In the bottom
examples, I added a cranked up Distorto value to each of the
rotations above That’s gotta hurt
STEPS: Creating a Filter Inside the Factory
1 Open an RGB image or convert some other image to the RGB mode This
fil-ter yields infil-teresting results even when applied to grayscale images converted
to RGB
2 Choose Filter ➪ Synthetic ➪ Factory Set all the slider bars back to 0, just in
case somebody’s been fooling around with them
3 Enter rad(d–(4*ctl(0)),m,0) into the R option box The first argument in
the expression — d–(4*ctl(0)) — subtracts four times the value of the top
slider bar from the angle variable d Why four times? Because the slider
only offers 256 increments, and the filter measures a full circle in 1,024
increments — 256 times 4 equals 1,024, thus enabling you to translate the
slider values to a full circle
R:1, G:2, B:3 R:80, G:85, B: 90 R:240, G:230, B:250
Distorto=10 Distorto=40 Distorto=140
Trang 2Meanwhile, d is the angle of the current pixel from the center and m is the tance from the pixel to the center So rad(d–(4*ctl(0)),m,0) tells the filter to lift
dis-the brightness from dis-the pixel in a counterclockwise direction from dis-the PBE.The result is that the red channel rotates in the opposite direction, clockwise.Drag the slider bar and you’ll see that this is true
4 Insert the phrase –ctl(4)/2 after the m so that the expression reads
rad(d–(4*ctl(0)),m–ctl(4)/2,0) You’ll use the second and third slider bars —
ctl(1) and ctl(2) — for rotating the other two channels But I think that I’d like
to use the fifth slider bar for distorting the image Why not the fourth nel? Well, because the first three sliders are going to be devoted to rotation.The distortion slider will be logically different, so it might be nice to create ablank space between the rotation and distortion sliders Not using slider four
chan-is the way to do it
By changing the expression to rad(d–(4*ctl(0)),m–ctl(4)/2,0), you tell
Photoshop to subtract half the value from the fourth slider from the from-center variable, thus shoving the pixels outward as you drag the fifthslider bar (the top of the two labeled Map 2) Give it a try
distance-5 Copy the R expression and paste it into G Select the entire expression in the
R option box, copy it by pressing Ctrl+C, tab to the G option box, and press
Ctrl+V to paste Then change the ctl(0) function to ctl(1) and the final number after the comma from a 0 to a 1, so that it reads rad(d–(4*ctl(1)),m–ctl(4)/2,1).
Now the expression takes rotation data from the second slider bar and lifts itscolors from the green channel The result is a rotating green channel
6 Tab to the B option box and press Ctrl+V again Change ctl(0) to ctl(2) and
change the final 0 to a 2 The result is rad(d–(4*ctl(2)),m–ctl(4)/2,2) Just to
make sure that you haven’t fallen behind, Figure A-46 shows all three sions exactly as they should appear
expres-By the way, a little yellow triangle to the left of the R, G, or B option boxes isPhotoshop’s way of telling you your formula contains some sort of error — amissing parenthesis or some other faux pas
7 Click the Save button and save your settings to disk You may want to use
the name Rotator.afs to show that it’s a Filter Factory file (For some reason,
afs is the accepted suffix for settings files.)
8 Adjust the sliders to set the defaults Before you turn this sucker into its own
filter, you need to be sure that the sliders are set how you want them toappear by default Every time you open the new filter for the first time during
a Photoshop session, these slider values will appear as they do now You maywant to set all sliders to 0 so that the user starts from square one, but it’scompletely up to you
Tip
Trang 3Chapter A ✦ Constructing Homemade Effects
Figure A-46: These three expressions let you rotate the three color channels
independently using the first three slider bars and distort the image using the fifth slider
9 Click the Make button to convert your code into a filter Clicking on Make
displays the dialog box shown in Figure A-47 Enter the submenu in which youwant the filter to appear in the Category option box If you want it to appear
with the rest of the Photoshop Bible filters, enter Tormentia Enter the name
of the filter, Rotator, in the Title option box Then enter copyright and authorinformation in the next two option boxes (Go ahead, give yourself credit
You’ve earned it.)
10 Select a Control check box for every slider you want to appear in your final
filter The Control check boxes along the right side represent the slider bars
inside the Filter Factory dialog box Select the check boxes for Control 0,Control 1, Control 2, and Control 4 Then name them appropriately My sug-gested names appear in Figure A-47, but they may be a little too clever foryour tastes
Watch out: The Filter Factory enables you to select any of the slider checkboxes, whether they were used in your formulas or not If you’re not careful,you can activate a slider bar that has no function
Caution
Trang 4Figure A-47: Click the Make button to display this dialog box, which
lets you name your filter, assign it to a submenu, and select the slider bars that you want to appear in the final dialog box
11 When you’re finished, press Enter Photoshop displays an alert message
announcing it has successfully created the filter
12 Press Escape to leave the Filter Factory dialog box.
13 Quit Photoshop and relaunch it Open an RGB image — like the Filter Factory
itself, any filter you create in the factory is applicable to RGB images only —and choose your newest command, Filter ➪ Tormentia ➪ Rotator The dialogbox should look something like the one shown in Figure A-48 Notice the gapsbetween the Blue Whirl and Distorto sliders Nice logical grouping, huh? Feelfree to drag the controls and apply the filter as much as you want It’s alive!
Trang 5Chapter A ✦ Constructing Homemade Effects
Figure A-48: The new Rotator filter complete with its four slider bars.
To see a demonstration of your powerful new filter, check out Figure A-45, in which I
applied the filter six times at various settings The top row shows the effect of
rotat-ing the channels to different degrees with the Distorto option set to 0 The bottom
row shows the same rotation values, but with the Distorto slider turned up to
vari-ous volumes It’s not the most practical filter on earth, but it’s diverting You might
even find something to do with it
By the way, those sliders have a tendency to move around after you finish dragging
them It’s very irritating If you’re interested in achieving an exact value, click at the
location where you want to move the slider triangle The triangle jumps in place
Then click, click, click to get it right where you want it
If you want practical filters, check out the ones I’ve included on the CD-ROM Most
are much more complicated than the one you created in the steps, but they all use
the variables, operators, and functions described in this chapter Open the settings
files to take a look at my code (Just click the Load button inside the Filter Factory
dialog box.)
To whet your appetite, take a look at Figure A-49, which shows all but one of the
Tormentia filters applied to that poor surfer woman whose nose I mushed back in
Figure A-45 (The one filter not shown is my Channel Mixer, which was so cruelly
usurped by Photoshop 5, as you may recall from my tearful account in Chapter 4
I guess I just don’t have the heart to show it any more.)
Cross-Reference
Tip
Trang 6Figure A-49: Applications of six Tormentia filters I created in
Filter Factory, which you’ll find on the CD-ROM Each filter has between 3 and 6 sliders, so you can create all sorts of variations
Figure A-49 shows only a few sample applications, many of them using the defaultslider bar settings Obviously, jillions of other variations are possible Have loads
of fun
Color Group Crisscross Full Channel Press
Noise Blaster Ripping Pixels Super Invert
Trang 7Actions
and Other
Automations
Creating Actions
If you’ve had a chance to check out Chapter D, you may be
impressed with just how many shortcuts Adobe provides
within the confines of Photoshop Although this may seem
like more shortcuts than you’ll ever need, it’s possible that
you will find yourself wanting more You still must choose
quite a few common commands from the menus Canvas Size,
Unsharp Mask, Variations, CMYK Color, and Color Range are a
few of the commands I dearly wish included keyboard
equiva-lents Frankly, I use all five a heck of a lot more often than
Show Rulers, Color Balance, and Gamut Warning, all of which
Photoshop has endowed with shortcuts
Photoshop’s answer is the Actions palette, which lets you
define your own keyboard shortcuts But the Actions palette
does more than simply let you assign a keyboard equivalent
to a command You can record an entire sequence of
com-mands and operations as a single action You can also
batch-process images, which means to apply an action to an entire
folder of files while you go off and have one of those power
lunches you’ve heard so much about If you spend a lot of
your time performing repetitive tasks, actions can help you
automate your workaday routine; then you can devote your
creative energies to something more important, such as a nap
For examples of real actions, read Chapters 10 and 17 Both
chapters contain recipes for correcting pictures you’ve shot
with a digital camera or downloaded from the Web
Creating and usingdroplets
Trang 8Recording an action
Choose Window ➪ Show Actions or press F9 to view the Actions palette The iconsalong the bottom of the palette — labeled in Figure B-1 — allow you to record opera-tions and manage your recorded actions An action can include only a single com-mand, as in the case of the RGB Color and Grayscale items listed near the middle ofthe palette in the figure Or you can record many operations in a row, as in the case
of the Adjusting Focus example
Figure B-1: The Actions palette lets you record
a sequence of operations and assign a keyboard
Action
Operations
Trang 9Chapter B ✦ Actions and Other Automations
If you’ve ever used a macro editor, such as QuicKeys or Tempo, the Actions palette
isn’t much different (If you’ve never even heard of these utilities, not a problem No
experience required.) Here’s a basic rundown of how you record an action
STEPS: Recording an Action
1 Select a set for your new action Just click the set that makes sense Or create
a new set by either clicking on the little folder icon at the bottom of the Actions
palette or choosing New Set from the palette menu Naturally, Photoshop asks
you to name the set
If you don’t want Photoshop to bother you with such trivialities as set naming,
Alt-click the folder icon to bypass the New Set dialog box
2 Create a new action This is very important Much as you might like to click
the record button and go, you have to first make an action to hold the recorded
operations Click the new action icon — the one that looks like a little page — or
choose New Action from the palette menu Photoshop responds with the New
Action dialog box, shown in Figure B-2
To skip this dialog box, use that Alt key again (In this case, I don’t
recom-mend it, but it is an option.) Alt-clicking on the new action icon takes you
directly to Step 8
Figure B-2: You can assign a name, function key, and color
to a new action
If you accidentally start recording and decide against it, just press Ctrl+Z to
both cancel the operation and undo the new action
3 Enter a name for your action Something descriptive, up to 31 characters long.
Tip
Tip
Trang 104 Choose a location for the action If you decide that your new action belongs
in a different set than you originally thought, choose another one from the Setpop-up menu If you’re content with the current hierarchy, proceed to Step 5
5 Assign a keyboard shortcut You can also assign a function key, F2 through
F12 (F1 is reserved by Windows for Help), with or without Shift and Ctrl Fromthen on, you can play the action simply by pressing the assigned function keycombination
When assigning function keys, it’s possible to overwrite one of the predefinedshortcuts listed in Chapter D By default, F2 through F4 choose Cut, Copy, andPaste Shift+F5, F6, and F7 are assigned to the Fill, Feather, and Inverse com-mands And of course, Ctrl+F4 closes the image As far as I’m concerned, all
of these shortcuts are up for grabs because the commands have alternativeshortcuts (You can press Ctrl+W to close an image, for example.)
But you might hesitate before assigning F5 through F9 These display palettesand there are no alternative shortcuts
6 Select a designer color The color affects the appearance of the action in the
Actions palette’s button mode, which I discuss in the “Playing actions andoperations” section later in this chapter
7 Press Enter to start recording The circular record icon at the bottom of the
Actions palette turns red to show you Photoshop is now observing your everyaction
Don’t worry too much about the choices outlined in these last four steps Youcan always modify them later, as I explain near the end of the next section
8 Perform the desired operations If you want to assign a keystroke to a single
command — such as Unsharp Mask — choose that command, enter some tings, and press Enter If you want to record a sequence of operations, workthrough the sequence as you normally would
set-But whatever you do, relax There’s no hurry and no pressure to perform Feelfree to take all day to figure out what you’re doing You can start to choose acommand and then change your mind You can even enter a dialog box andcancel out of it Like a kindly great grandmother (there’s that relative again!),Photoshop turns a blind eye to your hesitations and false starts Even if youmess up, just keep going Photoshop lets you insert, delete, and reorder oper-ations after you’ve finished recording an action
Photoshop does not necessarily record your every action Operations that arenot image-manipulation related, such as zooms, scrolls, and commands underthe View or Window menu, are ignored (However, you can force Photoshop torecord a command under the View or Window menu, as explained later in the
“Editing an action” section.) Here’s a good rule of thumb for determining whattype of operation Photoshop does not automatically record in an action: If youcan’t undo it, Photoshop won’t record it
Tip
Tip
Caution
Trang 11Chapter B ✦ Actions and Other Automations
After you complete an operation, Photoshop adds it to the Actions palette
The program constantly keeps you apprised of what it’s recording If you
perform an action and Photoshop doesn’t add it to the palette, you’ve been
officially ignored
9 When you’re finished, click the stop button That’s the square icon at the
bottom of the Actions palette Or, if you prefer, choose Stop Recording from
the Actions palette menu Congratulations, you’ve now successfully recorded
an action
Photoshop not only records your operations in the Actions palette, it also applies
them to whatever image you have open (If you open an image while recording,
Photoshop adds the Open command to the action.) For this reason, it’s usually a
good idea to have a dummy image open When you’re finished recording, you can
choose File ➪ Revert (F12) to restore the original, unmolested image
If your action includes a Save operation, try to use File ➪ Save As or File ➪ Save a
Copy This way, the original file remains intact
Editing an action
If you take it slow and easy, you have a good chance of recording your action right
the first time But no matter if you flub it Photoshop offers the following options to
help you get it exactly right:
✦ Adding more operations: To add more operations at the end of an action,
select the action and click the round record icon Then start applying the
operations you want to record When you finish, click again on the stop icon
If you selected the action before recording, Photoshop automatically adds the
new operations to the end of the action Or you can click a specific operation
name and then begin recording In this case, the new operation appears
imme-diately after the operation you clicked
✦ Moving an operation: To change the order of an operation, drag the
opera-tion up or down in the list You can even drag an operaopera-tion from one acopera-tion
into another if you like
✦ Copying an operation: To make a copy of an operation, Alt-drag it to a
differ-ent location Again, you can Alt-drag operations between actions You also can
select an operation and choose Duplicate from the palette menu Photoshop
creates a copy of that operation and inserts it directly below the original Now
you simply need to move the duplicate to its new location
✦ Investigating an operation: If you can’t remember what setting you entered
in a dialog box, or you don’t recognize what an operation name such as Set
Current Layer means, click the triangle before the operation name to expand
it Figure B-3 shows an example of a Set Current Layer operation expanded to
show that Photoshop has set the layer to 30 percent opacity
Tip
Trang 12(Now do you see why I think set is a bad name for those folder/group things
that hold actions? Commands have settings, the Actions palette records an
operation as being set, and now you can group operations into sets These
terms may be set in stone, but they don’t sit well with me.)
Figure B-3: Click the little triangles to expand
the operations and view their settings
✦ Changing a setting: If an operation name includes an embossed square to the
left of it — in the column marked Dialog box in Figure B-3 — it brings up a
dia-log box When you expand the operation, Photoshop tells you the settingsentered into that dialog box In the case of the Median item in the figure, forexample, the Radius value in the Median dialog box has been set to 3 Tochange the setting, double-click the operation name, revise the settings in the dialog box, and press Enter
On/Off
Expanded operationDialog box
Note
Trang 13Chapter B ✦ Actions and Other Automations
Photoshop will go ahead and apply the settings to your image If this is a
prob-lem, press Ctrl+Z to undo the operation This reverses the settings applied to
the image, but has no effect on the changed settings in the action The Actions
palette ignores Edit ➪ Undo (You can force the palette to accept the Undo
command, however, as I explain shortly.)
✦ Leaving a setting open: Not all images are alike, and not all images need the
same settings applied to them If you want to enter your own settings as the
action plays, click the faint square in front of the operation name in the dialog
box column A little dialog box icon appears, which shows that you must be
on hand when the action is played In Figure B-3, for example, a dialog box
icon appears before the Set Current Layer item When I play the action,
Photoshop leaves the Layer Options dialog box up on screen until I enter an
Opacity value and press Enter Then the program continues playing until it
reaches the next dialog box icon or the end of the action
Alt-click in front of an operation name in the dialog box column to display a
dialog box icon in front of that one operation and hide all others To bring up
dialog boxes for everybody, Alt-click the same dialog box icon again or click
the red dialog box icon in front of the action name
✦ Forcing Photoshop to record a command: If Photoshop ignored one of the
commands you tried to record, choose Insert Menu Item from the Actions
palette menu Photoshop displays the dialog box shown in Figure B-4, which
asks you to choose a command Go ahead and do it — the dialog box won’t
interfere with your progress Then press Enter to add the command to the
action In Figure B-4, for example, I’m forcing an action to display the rulers
Figure B-4: This dialog box forces Photoshop to record your command,
whether the program likes it or not
✦ Inserting a stop: A stop is a pause in the action You can’t do anything when
the action is paused — not in Photoshop anyway You can switch to a different
application, but Photoshop’s options are off limits until you cancel or
com-plete the action The purpose of a stop is to give you the chance to see how
the operations have progressed so far or to insert notes on the purpose of the
upcoming operation To add a stop, choose the Insert Stop command from the
Actions palette menu Then enter the message you want to appear when the
stop occurs Select the Allow Continue check box to enable you to continue
the action during playback
Tip
Tip
Trang 14I most frequently use a stop to jot down a couple of notes about the actionthat I’m constructing Sometimes I come across an action that I wrote a couple
of months previously and although it seems useful for a current project, Ican’t quite remember why I chose the settings for a particular operation.Luckily, because I’m in the habit of inserting a stop before such operations,
I can usually decide whether the action is right for the job
Another good use for a stop is to specify that a group of operations areoptional or are needed only under certain stated conditions For example, youcan create a multi-use action that includes instructions for all of its uses Onefinal note, I typically toggle a stop to the off position so that I’m not bothered
by its message every time I use it Because I know that one of my actions maywell contain a stop or two, I can check for them while I’m reviewing theaction’s merits
✦ Changing the name and function key: To change the name, shortcut, or color
assigned to an action, double-click the action name You can also choose ActionOptions from the Actions palette menu Up comes the Action Options dialogbox, which contains the same options as appeared back in Figure B-2 Changethe settings as you like Any function keys assigned to other actions appeardimmed Also, if you try to assign a keyboard combination (say Shift+Ctrl+F3)that’s been assigned to another action, Photoshop will deselect either the Shiftcheck box or the Control check box
✦ Deleting an operation: To delete an operation, drag it to the trash can icon at
the bottom of the Actions palette Alternatively, highlight the operation andchoose Delete from the Actions palette menu Easier still, select the operationyou want to delete, and then Alt-click the trash can icon (You can also merelyclick the icon, but Photoshop displays an irritating alert message Alt-clickingskips the message.)
Playing actions and operations
When it comes time to play your action, you can play all of it or just a single tion The simplest way to play back an entire action is to press the function key youassigned to it
opera-If you don’t like to fill your brain with ephemeral nonsense, such as what functionkey does what, you might prefer to switch to the button mode To do so, choose theButton Mode command from the Actions palette menu, as shown in Figure B-5 Youcan now see the colors you assigned to the actions, as well as the function keys.Just click the button for the action you want to play
But the button mode has its drawbacks All you can do is click buttons You can’tedit actions, you can’t change the order of actions, you can’t assign new functionkeys to actions, and you can’t play individual operations This is a great mode if you want to protect your actions from less adept users, but it’s an awful mode
if you want to modify your actions and create new ones
Tip
Trang 15Chapter B ✦ Actions and Other Automations
Figure B-5: Choose the Button Mode command
to view each action as an independent button
So, choose the Button Mode command again to return to the normal palette setup
Then try some of these less-restrictive action-playing techniques:
✦ To play a selected action, click the play icon at the bottom of the palette You
can also play an action by Ctrl-double-clicking on the action name
✦ To play an action from a certain operation on, select that operation name in
the palette, and then click the play icon
✦ To play a single operation and no more, drag the operation name onto the
play icon Or Ctrl-double-click the operation name
✦ You can tell Photoshop which operations to play and which to skip by using
the check marks in the on/off column (labeled back in Figure B-3) Click a
check mark to turn off the corresponding operation
✦ Alt-click a check mark to turn that one operation on and the rest off To turn
all the operations in the action on again, Alt-click the check mark again, or
click the red check mark by the action name
✦ If an operation has a dialog box associated with it, you can choose whether
Photoshop will stop and give you the chance to change its options If a
dual-toned box with three dots appears in the dialog box column (as in the case of
the Set Current Layer operation back in Figure B-3), Photoshop stops during
playback and displays the associated dialog box You can choose the settings
as you please
Tip
Tip