Author Topic: Watermarking Scripts & Actions  (Read 3737 times)

keithsnell

  • Administrator
  • Hero Member
  • *****
  • Posts: 1407
Watermarking Scripts & Actions
« on: March 12, 2008, 09:29:30 AM »
A new Watermarking Script is available in the download section. 

Introduction: I’ve long searched for a Photoshop action that was flexible, easy to use, and produced a watermark on my images that would protect them from unauthorized use, yet not be too obtrusive to the casual viewer. There are MANY watermark actions and tutorials on the web, yet no single solution met my criteria. I finally sat down and wrote my own Photoshop script, and I’m making this available to members of our Spirit of Photography community for their own use. This is watermarking function is written as a script in order to incorporate features that are not available through the use of actions, such as “conditional logic” and the ability to extract and use data from the current document. I’ll describe how to install and use the script in the instructions below.
 
There are two versions of the script. You can have them both installed and determine which to use based on your requirements. The first CopyrightWatermark script simply embeds a watermark in your image based on the conditional logic described below. The second “Sharpen and Watermark” script adds a “sharpen for web” step at the beginning of the process and can be used in conjunction with the image processor (described below) as part of an efficient workflow to batch process images to prepare them for display on the web.
 
Main features:
 
Conditional Logic:     
The scripts are primarily designed to produce a watermark from the copyright information embedded in the IPTC data of the file. So, if you have IPTC copyright information already embedded in the file, just run the script and it will insert a customized watermark based on that data.
           
If the script searches for copyright information in the IPTC data and doesn’t find any (i.e., the field is blank) it will insert a © symbol watermark in the image.
 
Supports batch processing: Once you have the script installed in the appropriate Scripts folder (see instructions below) you can record an action containing the script, and this action can then be used to batch process images. Simply start recording an action (name the action so that you recognize that it is implementing the copyright script), run the script and stop recording the action. You now have an action that can be run from Bridge to batch process images to prepare them for posting to a web gallery.
 
Easily “User configurable.” The real power of the script/action becomes available when you use it in conjunction with the “Image Processor” available in Bridge. For those of you not familiar with the “Image Processor,” it is a hidden gem in the Bridge menu that allows you to batch process images and save them in several image formats and sizes of your choice.
 
To use the Image Processor: In Bridge, select the folder or files that you want to process. Go to the Tools menu and select Photoshop => Image Processor. Select the save location, file type, quality and size of the images you want to save. If you are posting images on the web, you want to also select the “convert profile to sRGB” and “include ICC profile” check boxes. I’ve found that the optimum “resize to fit” setting to display images in most web galleries is 800 pixels for both width and height.
 
To integrate the Watermark Script with Image Processor: Assuming you have already recorded an action containing the script, in the preferences section of the Image Processor select “run action” and use the drop down menus to select the watermark action you previously recorded containing the script actions. Selecting the “Sharpen and Watermark” script will provide you with the capability to save complete web-ready images in a single batch process. (Sized, converted to sRGB profile, appropriately sharpened, and watermarked images will be stored in your selected save location when you click on the “Run” button.)
 
Note the “Copyright Info” box at the bottom of the image processor. Any information typed into this box will take precedence over both the embedded IPTC information in the file, or the alternative to embed a simple © symbol watermark. Use this box to set the watermark text that you want inserted for this batch of images, or leave it blank to allow the script to extract your copyright information from the image IPTC data.
                                                                                                         
Instructions for installing the script in the appropriate folder on your hard drive:
 
MACINTOSH
Extract the files from the zip folder you downloaded and copy and paste the script files into this directory/folder:
Applications/Adobe Photoshop CS3/Presets/Scripts
 
PC
Extract the files from the zip folder you downloaded and copy and paste the script files into this directory/folder:
Program Files/Adobe/Adobe Photoshop CS3/Presets/Scripts
 
(For Photoshop CS2 or CS, substitute “Adobe Photoshop CS2” or Adobe Photoshop CS” for “Adobe Photoshop CS3” in the path above.)
 
Instructions for running the script:
 
After installing the script in the folder listed above, restart Photoshop and open your image for processing. In Photoshop “File” menu select “Scripts” and then either the CopyrightWatermark or Sharpen & Watermark script. The script will run automatically once selected. Note that the script will return an error of there is no document open.

If you use the script, please provide feedback and recommendations for improvements.

(The link to the Download section is at the bottom left of the HOME page.  This link is only visible to members; however membership is free so all you need to do is complete the registration process in order to access the download.)

Keith

rod1

  • Newbie
  • *
  • Posts: 39
Re: Watermarking Scripts & Actions
« Reply #1 on: March 17, 2008, 11:13:10 PM »
Hello Keith, I finally got around to downloading and using the Copyright watermark. Thank you. I was able, easily, to get the symbol up but was unable to add script. Have read through your instructions repeatedly but remain blank. Dosn't matter really, but thought if others can, so can I! ...(wrong). Any help appreciated. Thanks.Rod.

keithsnell

  • Administrator
  • Hero Member
  • *****
  • Posts: 1407
Re: Watermarking Scripts & Actions
« Reply #2 on: March 18, 2008, 08:10:13 AM »
Rod,

Thank you for asking a question and not just giving up.  So, if I understand you correctly, you were able to install the watermark script and can run it and get the copyright symbol on your files, but can't add text in place of the symbol? 
 
If so, sorry about that, I didn't go into detail about how to add the text.  There are two ways to add text instead of the symbol:

1)  With your image file open in Photoshop, on the "file" menu select "file info."   In the pop up window that opens you will see a "copyright notice" field (2nd from the bottom).  Type in your copyright (or name) in this field click OK, and then save the file.  When you run the script, it will put what you typed in this field on the watermark.

Please try this and let me know if it works.  If so, then I'll talk you through using the "image processor" and the script.  (I said in the text above there were two ways to add text, using the Image Processor is the second, but I want to make sure method #1 works for you first.)

Keith

rod1

  • Newbie
  • *
  • Posts: 39
Re: Watermarking Scripts & Actions
« Reply #3 on: March 18, 2008, 09:39:14 PM »
Hello Again Keith, fantastic. Watermark worked exactly as you directed. Ready for next 'lesson'. Thank you for your time. Rod

keithsnell

  • Administrator
  • Hero Member
  • *****
  • Posts: 1407
Re: Watermarking Scripts & Actions
« Reply #4 on: March 18, 2008, 11:13:56 PM »
Rod,

Excellent.  I'm glad that worked for you. 

Now I'm going to talk you through recording an "action" of the script, and then using that in conjunction with the "image processor."  This is a much more powerful way of using the script, but takes a few more steps to set up properly. 

1)  Make sure you have an image file open in Photoshop.

2)  Open the actions pallete in Photoshop.  The easiest way to do this is through the "window" menu.  Click on the "Window" menu at the top of your Photoshop window and then move your cursor down and select "Actions."  This should open up your actions pallete. 

3)  Create a new action set.  At the bottom of your actions pallet is a set of six icons.  Hover with your mouse over the third icon from the right (looks like a folder) after about a second or so you should get a popup that says "create new set."  This just confirms that your over the correct icon/button.  Now click on this button and you will get a small window titled "new set."  Type in a name (call it Rod's Actions or some other descriptive name) then click OK.  Your new "set" should now be highlighted at the bottom of the actions pallete.  This is essentially a "folder" for the action you are going to record. 

4) Begin recording your action.  At the bottom of your actions pallet, hover over the second icon from the right, and wait for the popup that confirms you are over the "create new action" button.  Click on the button.  You should see another new window titled "new action."  Type in "watermark action using script" or some other descriptive name and click on record.  From this point on, Photoshop will be recording your mouse clicks in an "action" (which is like a script, but with a difference that we will take advantage of in a few minutes.) 

5)  Run the script. From the File menu select "Scripts" and then the name of the watermark script you want to record.  Let the script play all the way through.  When its done, click on the square button at the bottom of the actions pallete (the first button on the left), this will stop the recording of the action.  You now have an "action" that you can use in a batch process to watermark your images.

Now I'll talk you through using this action in a batch process in conjunction with the image processor.  This is just an example, so after you see how it works you can use this process in the future.

6)  Go into Bridge and single click on a couple of files to select them.

7)  On your Bridge "tools" menu, select "Photoshop" and then "image processor."  You should see the "Image Processor" window pop up, with four numbered steps. 

Step 1 in the image processor window says "select the images to process," and underneath this should say "process files from bridge only" with a number in parentheses showing the number of files that you selected in Bridge.  (When you run the Image Processor from Bridge, Step 1 will always default to "process files from Bridge Only.")

Do NOT check the "open first image to apply settings" block.  This is only used if you are opening raw images and want them all to use the settings applied in the first image.

You can leave the settings in step 2 at their default settings (Save in Same Location) and the image processor will save your new files in a sub-folder inside your current folder. 

8.  Under Step 3 in the Image Processor, select "save as JPEG" and type in "8" in the box afer "Quality"  (JPEG 8 is a good compromise between quality and size).

9)  Check "resize to fit" and then type in 800 in both the width and heigth boxes. 

10)  Check the "Convert Profile to sRGB" box.  (You want to use sRGB when posting to the web.)

11)  In step 4 of the image processor window (Prefrences) check the "run action" block.  To the right of the "Default Actions" block is a drop down menu (blue arrow) click on this and select the action set you named in step 3 above (Rod's Actions).  In the next block over, select the "watermark action using script" that you recorded in steps 4 and 5 above. 

12)  In the Copyright Info box, type in the text you want to use for your watermark.  (Yeah!  we're finally there! :) )

13)  Click on the "Run" button in the upper right corner of the image processor window.  (Kind of curious why they didn't put that button at the BOTTOM of the window!)

The image processor will run and batch process all the images you selected in Step 6 above.  It will resize the images, convert to sRGB profile, place your copyright information in the file, and save the file in the new folder with the watermark.  If you selected the watermark script that had a sharpening step, it will sharpen the images as well.

The next time you want to batch process a bunch of images to get them ready to post, all you have to do is run the image processor and select the action you recorded earlier.  (No need to re-record the action in the future.)

By the way, if you don't want to include the watermark, just uncheck the "run action" step in the Image Processor window, and you can use the Image Processor to batch process your images, resize, and saving as JPEG etc. without a watermark.

I hope this helps.  It is late at night here, so it is possible that I forgot a step or two.  Please let me know if you have any problems with these instructions.

Keith

rod1

  • Newbie
  • *
  • Posts: 39
Re: Watermarking Scripts & Actions
« Reply #5 on: March 19, 2008, 03:53:41 AM »
Hello Keith, I am very deeply appreciative for your effort in notating all the steps above, for me. Time here is just after 20:30 and, like you were last night, I also am weary and, have been working through the steps, with Dylan and his mother arguing in the background. (Life, as always, continues on...unabated!). Anyway, all goes well till
5).."Run the script. From the File menu select "Scripts" and then the name of the watermark script you want to record.  Let the script play all the way through. "..I feel rather silly asking you How? How do I know when it is finished?...I actually worked my way through all 13 steps and ended up with a folder full of jpeg images, without watermark. Oh, I used NEF (RAW) files in the first instance then read your comment at the end of Step 7!  "Do NOT check the "open first image to apply settings" block.  This is only used if you are opening raw images and want them all to use the settings applied in the first image." Keith, I will run through all the steps again over the weekend. (more time to spare/waste on my hobby). I do feel rather inadequate not being able to work through all this but will persevere till I get it right. Perhaps the adage about 'Old dogs and new tricks' is somewhat applicable here!  Once again, many thanks for putting up with my slow aquaintence with new technology. Rod

keithsnell

  • Administrator
  • Hero Member
  • *****
  • Posts: 1407
Re: Watermarking Scripts & Actions
« Reply #6 on: March 19, 2008, 07:53:39 AM »
Rod,

Since you ended up with a folder full of JPEG images, we will declare ourselves partially successful!  :)

To answer your question about "how do I know when it [the script] is finished?"   At the end of the script, you should see your watermarked image on the computer monitor.  Once you have reached that point you can stop recording the action. 

One of the best ways to troubleshoot and try to figure out where we went wrong is to break the problem into smaller chunks.  We know from your previous success that you can run the script by itself and get a watermark, so that shouldn't be where the problem is. 

Now that you have "recorded" an action (steps 1 through 5 in my previous instructions), we should be able to run the action by itself to test whether or not it was recorded correctly.  First, open an image to test the action on.  To run the action, open the actions palette (window menu then "actions").  You should see the action you recorded earlier listed on the palette.  Single click on the action name to highlight and select the action.  (Make sure you are selecting the action listed underneath the action set you created, not the top level action "set".)  Now click on the "play selection" button at the bottom of the actions palette.  The action should play the watermark script, and when it is finished, you should see your watermarked image on the screen. 

Please try that much of the sequence and let me know whether you were successful.  If the action doesn't correctly embed a watermark in the image, then we will need to record the action again.  (Make sure you have an image open when you record the action, and that image is correctly watermarked after the script runs.)

If you get to the point where you have an "action" that works properly, then running the action in conjunction with the image processor is just one easy step away.   :)

By the way, Rebecca, Evan and I will be going out to Rebecca's family ranch this coming Friday, and will be there for about 10 days "working cattle."  (All those little newborn bulls need to be transformed into little steers, etc.)  I mention this only because I will have limited access to the computer during that time.   Hopefully there will be enough discussions on the forum during that time to keep people from getting bored and leaving.

Keith