Applying Image Effects to Preview Documents


The Preview application in Mac OS X Leopard offers powerful controls for editing color, keywords, and sizing atributes of images. If you've ever wanted to add the ability to apply special image effects to these image editing options, here's a simple three-action workflow that lets you apply Quartz Composition Filters to images opened in the Preview application.

The workflow droplet will duplicate the dragged-on image and then apply a chosen Quartz Composition Filters to the copied using paramters set when the workflow is run.

Creating the Workflow

The first step in the automation recipe will be to duplicate the current image document open in Preview. Launch Automator and create a new blank custom workflow document. Select the Files & Folders category from the Library list to reveal the actions designed to work with documents. Then locate and add the Duplicate Finder Items action to the workflow by dragging it from the Actions list to the workflow area.

The next step is to add the action for selecting and applying a desired image effect to the image. Select the Photos category, and locate and add the Apply Quartz Composition Filter to Images action from the related Actions list to the wrokflow.

Once you do, this drop-down warning dialog will appear. Automator is designed to warn you when you are adding an action that will permanently alter documents and provide you with an option to add a duplicating action to the workflow so that any alterations are done to a copy and not the original file.

Since this workflow begins with an action to duplicate the existing file, adding a copy process is not necessary. Click the Don't Add button to finish adding the chosen action to the worlflow.

To enable the ability to select the image effect to apply when the workflow is run, click the Options buton at the bottom left of the action view and select the checkbox titled Show this action when the workflow runs.

The last step in the workflow will be to open the processed image in Preview, so locate and add the Open Images in Preview action from the currently selected Photos category action list.

The workflow is complete and you're ready to save it. Choose Save from the File menu, and select Application from the File Format popup menu in the saving dialog. This will save the workflow as a self-running application that can be used as a droplet. Name the workflow Apply Effect to Copy and save it in a convienient location, such as an Applications folder in your home directory.

After the workflow has been saved, close its window in Automator, and locate the saved application on your disk. Drag its icon to the Dock to add it to the list of applications.

Using the Workflow

To apply an effect to an image opened in Preview, drag the image's document proxy icon from the image document's title bar...

onto the workflow's icon in the Dock.

The workflow application will open and begin processing the dragged-on document file. The action view dialog for the Apply Quartz Composition Filter to Images will display. Select the image effect from the popup list and adjust any parameter options. Click the Continue button to apply the chosen effect to the image file.

Once the effects processing has completed (some effects make take a few minutes to complete), the processed duplicate of the dragged-on image file will open in Preview.

Making a Variation of the Workflow

The workflow you created will always create a duplicate of the the dragged-on document file before applying an image effect. If you want the ability to process the dragged-on image without duplicating it first, create another workflow varient by opening the saved workflow in Automator by dragging its icon on the Automator icon.

Remove the first action in the workflow (the one that duplicates the file) by clicking its close box at the right of its action view title bar. The, choose Save As... from the File menu and save the workflow as an application named Apply Effect to Original in the same location as the previous workflow application. Drag its application icon to the Dock, next to the previous workflow application.

You can now apply additional effects to the already processed duplicate image file by dragging its document proxy icon onto the workflow application in the Dock.