Join Deke McClelland for an in-depth discussion in this video Real-world action 1.3: Resizing the watermark, part of Photoshop CS2 Actions and Automation.
- [Instructor] Here we all are, high on the buzz of having created an action that successfully adds a digital watermark to this image right here. Naturally, what we want to do at this point is test it out on a higher resolution image and see if indeed there are any problems. Maybe there won't be, maybe we'll luck out So what I want you to do is in addition to having this image open, I want you to open up Andrzej Burak 2.jpg and this image is twice as tall, twice as wide, four times as big as Andrzej Burak 1, so it's a much bigger image.
I want you now to go ahead and select Attempt #1, the action that you created in the previous exercise. If for some reason something went wrong for you, you weren't able to record it, I got your back. You can go to Load Actions and go inside that same 04_actions_3 folder. You will see, among other things, a file called Watermarks.atn. Go ahead and load it up if you want to, if you need access to a functioning Attempt #1, but however you get to it, go ahead and select Attempt #1 and then I want you to click on play, and we'll see how well things work.
Not very well at all. Did anything go right with this? That's what I'm wondering. How many other things could've gone wrong? Let's go and twirl open the Watermark group here and we'll see there's the bar, alright. There's the bar. Not nearly tall enough, not nearly wide enough, totally in the wrong position, the woman has a mustache, it's covering up her nose, yikes. And supposedly we've got text. So we have text in this document? Can anybody tell me where the text is? It's there inside the layers pallet. If you want to see where text is, double click on the T icon.
It's there, go figure. It's invisible of course because it's text that's knocking out nothing, that's nice. So press the esc key in order to escape out of the text editing mode. I'm going to go grab my Move tool and move the text up here so we can see it. That's great, dinky little text right through this woman's nose. Could it be worse? Alright, press the F12 key. Just make it go away. She looked so great before I mess her up. Let's go back to Andrzej Burak 1.psd complete with its layers, whether or not you're looking at the grouped version of the layers or whether you're looking at the original version of the image, that doesn't really matter.
I just want to make sure that you have these layers intact because we're still going to need them so that this image serves as a template for our additional manipulations. Now we've seen the bad news. That was a car crash, but turns out there's not that much wrong with Attempt #1. There's only a few steps that need to be modified, believe it or not. Just a few things that went wrong. So let's go ahead and duplicate this action. We know it mostly works. What I don't want you to do is just start editing it because there's always a risk you could mess it up and turn something that worked reasonably well at least inside of this image, turn it into a complete disaster.
Just go ahead and twirl that closed, grab Attempt #1 and duplicate it by dragging it on to this little page icon. Another way to duplicate an action is to drag it on the new action item. And then change Attempt #1 to Attempt #2. Change its name. Now let's twirl it open and take a look at the individual steps. We have Make text layer. Something could be wrong with that because after all that created the text. It added the text on the page but it also formatted the text and the type size was too small inside of a larger image, so we'll probably have to do something about this step.
Move current layer, that moved the text into its current position. That was absolutely wrong, so we've got to rerecord that step. Reset Swatches, that was fine. Reset the swatches to black and white. That worked. Make fill layer, that drew the rectangle. Boy did that go kablooey. Everything else is fine. So the only problems are this guy, this guy, and this guy. Those three steps are our bad apples. Everything else is just hunky dory. Alright, so go ahead and select Attempt #2 again. I want you to go to this first step, make text layer, and ctrl or cmd double click on it.
Ctrl double click on it on the PC, cmd double click on it on the Mac, and the reason I'm having you do that is so that we establish that text again once again at the relative position at which we created it. We need to start with this text in this position before we stand a chance of getting it down here properly. Now I'm going to record a new step that moves it into the proper location. So we're going to basically replace this step, and if you want to, you can go ahead and throw this move current layer step away. You can go ahead and throw that way right now and then click on make text layer and then click on the record button and now let's think for a moment.
We're working inside of some unit of measure and it might be pixels, or inches, or centimeters, what have you, but it's a unit of measure that exists independently of the full size of the image. We need a unit of measure that measures distances relative to the height and width of the image and that unit of measure would be percents. We can actually change the unit of measure to percents, so that's what we ought to do. Press ctrl R on the PC here or cmd R on the Mac to bring up the rulers then I want you to right click on either ruler, either this ruler right here, the horizontal ruler at the top of the image, or the vertical ruler over here on the side, and that brings up a list of your units of measurement.
On a Mac, if you don't have a right mouse button, you would press the ctrl key and click, and I want you to change it from whatever it is, for me it's pixels, I want you to change it to percent. Now the actions palette doesn't actually record any of these changes, but it will record the movement now as a percentage instead of as a pixel level movement. Okay, so I'm going to press ctrl R or cmd R once again to hide the rulers from view, and now let's drag above the text with the move tool that we get these smart guides working properly, and you need smart guides to be working.
Go to the View menu, choose Show, and make sure that Smart Guides has a check mark in front of it. Mine does, so I'm fine. Now drag above the text like so and drag it into position so you get that magenta box all the way around the text so it's absolutely where it needs to be. Now let's check on what happened inside the actions palette. So far nothing because recall when we're making movements the actions palette is always waiting for us to do the next thing so it knows that we're done moving. The next thing's going to be to stop recording. Let's just stop recording. Then it moves the current layer, let's twirl that open, it moves it as a percent.
- 2.2%, 69.6%, I don't know what that means. That's Photoshop once again talking to itself. The thing that I care about is it is a percent, awesome. Alright, so that step is now taken care of. Let's throw the text away. We don't need it anymore for the moment anyway. Now what we're going to do is we're going to replace this make fill layer. This is the layer that makes the rectangle so go ahead and throw that step away, click on Reset Swatches because the step needs to occur after this point, click on record, we're still working inside percent, so I'm going to press shift tab to get rid of those palettes for a moment, I'm going to press the F key to go to the full screen mode, I'm going to get my shape tool here, my rectangular shape tool, and I am going to just redraw that shape and make sure it snaps into position like it is.
I can use the space bar to help with the snapping if I want to. So get that rectangle into the exact right position with a little extra left in the left, right, and bottom edges, and then release, and that should result in a black rectangle that is fully opaque like this one here. Covers up everything. Okay, that's fine. Now, press the F again to cycle through back to your regular screen mode. That'll take a couple of presses of the F key, and press shift tab to bring back the palettes. It did make a fill layer, so we're done.
Press stop, and we've now fixed two of the broken steps, believe it or not. Alright, so I'm going to take this new layer and throw it in the trash. We don't want it. It was just there because we drew it as we were recording the action. Let's go back to Andrzej Burak 2.jpg. Actually, it's the same woman, just different. She's in cotton balls and so the glasses... Go to attempt #2, select that action, and click play. Yay! (laughs) That worked, that's not bad, right? It put the text in the right location, the base line is exactly where it needs to be, it drew the rectangle the right size, and put it in the right location as well.
The only thing wrong is the type size. The type size is too dinky, so press F12 again because we need to get back to the original version of her since she's our guinea pig here. Go back to Andrzej Burak 1.psd. There's only one problem now: That's Make text layer. Now, wouldn't it be great if you could set the unit of measurement for text to percent? Alright, let's check out if you can. Press ctrl K, or cmd K on the Mac, to bring up the Preferences dialogue box. There's General. I want you to change it from General to Units & Rulers and notice there's rulers set to percent.
Now you can change it back to pixels or inches, whatever unit of measurement you're comfortable working in because after all, we recorded the action using percentage values now. Doesn't matter what our rulers are set to from now on as long as the action is set to percentage, we're golden. Type, there's Type set to points. Can we set that to percent? No we can't. Alright, there is no percent option here. You've got pixels, points, and mm. Leave it set to points. I want you to work in points because you need to work along with me here. So we need agreement. Go ahead and click okay at this point in order to accept that one change if you want to.
So we can't measure type as a percentage of the image size, but we can measure it in points, and points are sensitive to the resolution of the document. So if we change the size of the document before we add that text, then the text might be sized properly. Let's give it a try. Alright, so what I want you to do is make sure Make text layer is active. Make sure that one's active for starters, and go ahead and click on record and I want you to go up to the image menu, choose Image Size, or you could press ctrl alt I or cmd option I on the Mac, to bring up the Image Size dialogue box.
Now, it's probably going to look something like this for you where all the check marks are on or at least these two guys are on. What I want you to do is turn off the Resample Image checkbox and that ensures that whatever we do to the image, we're not changing the number of pixels inside the image. Then I want you to change the width to 6 inches, alright? You could change it to really anything you want to, but if you're going to follow along with me, you need 6 inches. Click OK, don't change anything else, click OK. And now let's check out this step we just recorded.
Image Size Width: 6 inches. That's all it did. That's all it knows. It didn't pay attention to anything else we did. Groovy! Click stop. And the reason I'm having you click stop is actually this Image Size command here has to go before Make text layer, but I couldn't do that when I was recording it. I had to put it in that position because well, for a lot of reasons. Anyway, just move it up to where it needs to be. Now let's go to Make text layer. Having gotten the image size to what it needs to be, let's go to the Make text layer step and I want you to double click on it, and what that does, instead of ctrl double clicking or cmd double clicking, that brings the text in and formats it as it was last formatted, and gives you the chance, it keeps things highlighted, gives you the chance to go ahead and change the formatting if you'd like to.
So I'm going to change the type size to 9.97 points and this will be the right size, just turns out... I did a little work here to figure it out. Turns out to be the right size, 9.97 points, to fit an image that's six inches wide. So the text will fit an image that is six inches wide. Isn't that great? Now press the enter key on the keypad a couple of times in order to accept that new text, and we're done. That worked. So you should see, just to make sure that we're all on the same page, Attempt #2 starts with Image Size, twirl it open, looks like 6 inches.
Make a new text layer, among other things, it now includes a type size of 9.97 points. Moves the current layer as a percentage. You should see some percent values there. Resets the swatches fine, makes a fill layer, also measured in percentages, and on and on and on. All the other steps were fine. Alright, throw this text layer away. It was just a dummy layer, once again just to make the action work. Let's go into Andrzej Burak 2.jpg, go ahead and select Attempt #2, go ahead an select that action, click play.
(speaking in foreign language) Oh my gosh, does that work beautifully or what? Is that nice? You have now created a series of steps that will put a bar at the bottom of a horizontal image regardless of what resolution it is. It will set that image to six inches wide, that means it's going to change the resolution accordingly, but it's not going to throw away a single pixel. It will format the text to fit inside of six inches and it will put everything at the bottom of the image window where it belongs. Now you may wonder at this point, "Okay, it just got done changing my image size, right? What if I want to change the image size back to something else?" Just fine.
Go ahead and press ctrl alt I on the PC, or cmd option I on the Mac. You've got a 6 inch wide image, the resolution is any old thing. Let's say you know you want to print the image at 300 pixels/inch. That's going to make it 4.8 inches wide. That's just fine. Make sure Resample Image is turned off so you don't harm the pixels, click OK, just fine. Does not harm the text from this point out. So Photoshop is now smart enough to resize the text to fit the new resolution. So there you go. We have now created an action that adds a digital watermark, we have fixed the action so it serves any horizontal image.
In the next exercise, we're going to make it fit a vertical image.