Sunday, October 18, 2009

Batch Process Photos with Phatch

Virtually any photo manager out there lets you perform mundane tasks like adjusting contrast, adding a watermark, or applying effects to your photos. But even the most powerful applications like digiKam or F-Spot can’t really help you when you need to perform the same action (or a sequence of actions) on dozens or hundreds of photos. For those tasks you need a batch processing utility like Phatch. This nifty tool can perform no less than 35 different actions on your photos, and its user-friendly graphical interface makes it easy to create advanced multi-step batch rules (or action lists in Phatch’s parlance).
If you are using Ubuntu, installing Phatch is as easy as downloading its .deb package and double-clicking on it. If you want to be able to view EXIF and IPTC data, you should also install the python-pyexiv2 package, and for a “cool nautilus integration” Phatch’s Web site recommends installing the python-nautilus package. Unlike conventional image editing applications, Phatch doesn’t allow you to edit photos directly — instead, you use it to set up actions. An action in Phatch is a single operation that the application performs on the photos that are fed into it. Each action offers a number of options: for example, the Scale action allows you to specify the width and height, resolution, and resampling algorithm. You can add as many actions as you like, and the project’s wiki ( http://photobatch.wikidot.com/actions) provides a list of all actions supported by the Phatch.
To add an action to Phatch, press the Add Action button and select the desired action from the list. You can narrow the list to a specific action type by selecting a category from the Select drop-down list. Alternatively, you can use the Search feature to search for a particular action. In this case, choose the Scale action and press the Add button. This adds the selected action to the main window, and you can use the available options to tweak the action.
For the Scale action, for example, you can choose to scale down the photo by a specified percentage value or to a predefined size measured in pixels. If you wish to change the image resolution or resampling algorithm, you can do so by adjusting the appropriate options. Once you are satisfied with the settings, you can add the next action and specify its options. In a similar manner, you can add other desired actions.
Finally, you have to add the mandatory Save action: without it, Phatch wouldn’t know where to save the processed photos. Besides options such as output format and quality, the Save action also offers a set of variables that you can use to specify a destination for the processed photos. For example, using the default _phatch/ variable, Phatch saves the processed images in a separate folder inside the source directory. The /phatch/// variable, in turn, creates a directory structure based on the current date. By the way, you can rearrange the actions in the list using drag-and-drop. This, of course, doesn’t apply to the Save action that must always be the last action on the list.
To process photos using the created action list, press the Execute button, choose the directory containing the photos you want to process, and press the Batch button. You should then see the processed photos in the destination directory. While using the Execute command every time you want to run photos through Phatch is not that difficult, the application offers another nifty feature that makes the batch process even more straightforward. Choose View -> Droplet, and Phatch turns into a floating icon. Drag photos onto it, and Phatch processes them using the currently opened action list.
Although Phatch is first and foremost a GUI tool, you can run it from the command line, so you can automate the batch execution and put Phatch to some interesting uses. For example, you can turn your computer into a batch photo processing server, and you can find a more detailed description of how this can be done at Phatch’s wiki .