Sunday, January 20, 2008

Photoshop Scripting - part I

Did you know that you can use a scripting language like Javascript in Photoshop? Well, the answer is yes! And, if you have some programming skills the things you can write are pretty much unlimited.

If you've used actions in Photoshop then you already know the advantage of automating repeated tasks. Not only to you avoid the tedium of repeating the same thing over and over again but you also avoid errors.
What are the advantages or reasons to use scripting instead of actions? Well, a few come to mind:
  • a script can use conditional logic to make decisions - an action can't
  • greater access to file functions
  • pretty much access to all the functions in Photoshop: layers, history states, channels etc. and all this at a much more involved level than with actions

May I suggest that you go to the Adobe Photoshop Developer Center, Photoshop Scripting page and check out the documentation. BTW, you can find the same PDFs installed under the Photoshop program directory under Scripting Guide directory. There is also a Sample Scripts directory.



OK... where do you start? Choose a scripting language. Three are available:

  1. Javascript
  2. Applescript
  3. VBScript

I will be discussing scripting using Javascript as that is the most portable in my opinion.

Next, let's find out how to install a script and then how to run or execute this same script.


Sunday, August 05, 2007

Black & White using LAB mode


Using the LAB mode "Lightness" channel is another way of getting good B&W images. Let's start with the following image:



Convert to Lab Color mode. Go to Image->Mode->Lab Color. Next, go to the Channel palette and click on the "Lightness" channel.



Change the mode back to Grayscale (menu: Image->Mode->Grayscale) and accept to "Discard the other channels?" when the dialog box pops up.





If the Lightness channel looks ok then you might be finished. Otherwise the image may need to be darkened as the light areas may be too light (It is called the Lightness channel after all). If this is the case, duplicate your layer (Ctrl-J) and set the new layer's blending mode to "multiply".



If this is too dark, adjust the opacity of the new layer. In this case I set the opacity to 36% which is perfect for the face. However, the jacket could use a bit more contrast. Adding a layer mask to the multiply layer and painting over the areas that need lightning with black adds a bit more pop.





Finally I added a Levels Adjustment layer with a slight tweak of the whites. You may want to change the Mode to RGB (best for web presentation)


Tuesday, July 31, 2007

Black & White using Channels


With the advent of Photoshop CS3 there's a really cool image adjustment tool for creating black and white images now. Like the channel mixer on steroids it comes with some pretty cool presets. *But* if you want to roll your own there are many tried and true methods for converting to black and white (without using the Image->Mode->Grayscale). Let's start with a colour image of bassist Brandi Disterheft taken at the Montreal International Jazz Festival:



Check out the channel palette and select the best looking black and white image by clicking on the
individual channels: red, green, or blue. (Note: if the channels don't display in grayscale, turn off the "Display
Color Channels in Color" option under Preferences). In this case, the best black and white was the Green Channel.



From the palette menu, select and click on Duplicate Channel...



In the Duplicate Channel dialog, choose the "New" document option.



Change the resulting document to Grayscale and duplicate the background layer (Ctrl-J)



Change the mode of the new layer to something like: Overlay, Soft Light, Multiply etc.. and adjust the opacity. (Note: this step may be optional - it all depends on the look of your image.)



You may want to change the Mode to RGB (best for web presentation)





Tuesday, January 30, 2007

Fall Colours


Let's take an existing photo and easily emphasize autumn colours (in this case yellow/orange tints)



First, add a Hue/Saturation adjustment layer from the Layers Palette.



Select Yellows from the Edit dropdown menu. Slightly increase the Saturation. Change the Hue by moving the Hue slider to the left towards orange. Click OK.



Using a soft brush and Black as the foreground colour, paint on the adjustment layer's mask to bring back some of the original colour in selected areas.