Volume Number: 16 (2000)
Issue Number: 7
Column Tag: Tools of the Trade
by Bill von Hagen
Automating graphics processing, conversion, and manipulation
The Tower of Babel is the biblical root of multiple languages on the planet earth. DeBabelizer's name suggests that its goal is to cut through the confusion of multiple graphics formats. This would be a pretentious product name (which has never really affected product naming before) if it wasn't essentially true. Simply put, DeBabelizer is the best graphics manipulation software I've ever used on a computer that I could actually afford to own and fit in my house.
DeBabelizer provides an impressive number of powerful graphics file manipulation, transformation, and conversion commands. To simplify performing the same transformations on large numbers of files, DeBabelizer enables you to store sets of transformations and apply them across user-defined sets of graphics files. Though batch processing is something of a anachronism in today's GUI-based personal computer software, sometimes it's exactly the right thing. I've used earlier versions of DeBabelizer for years to refine screen captures from Windows and UNIX systems for use in help files and printed documentation. My goal is usually to convert them into another graphics format, resizing them without sacrificing image quality, and reducing the number of colors used. In this sort of situation, you need to make sure that you apply exactly the same set of transformations to the entire set of files so that you don't subsequently encounter any color or size surprises when using the converted files. DeBabelizer shines at this sort of task.
Any modern graphics tool ignores the needs of the World Wide Web (and, to a lesser extent, those of other graphics packages) at its peril and to the detriment of its sales. DeBabelizer can quickly transform any input graphic into the GIF, JPEG, or PNG graphics formats used on the Web. DeBabelizer's other output graphics formats range from the file formats used by specific graphic packages such as PhotoShop, Degas, and Pixar's graphics tools, to basically every "standard" graphics format that anyone has ever proposed. (In fact, there are so many of them, that you will wonder if standard is the right word, but as the old saying goes, "You are in a maze of conflicting standards, all different.") Users of Apple ][ graphics packages will rejoice that classic output formats for the GS, ][e, ][c, and ][+ are available, and users of high end systems like SGI boxes and the Sony PlayStation will be similarly pleased to know that their graphics format needs haven't been overlooked.
There are three basic ways of using DeBabelizer. First, you can use the tool interactively, performing specific transformations on a single file. Used in this way, you explicitly open a file, do the transformations, and then save the file with any name you want. Second, you can create a DeBabelizer script consisting of a set of transformations onto which you drag and drop specific images to manipulate them. This type of script generally includes a command to save the file, using some clever mechanisms provided by DeBabelizer for giving your output files unique and different names. Finally, you can create DeBabelizer scripts that only consist of a set of graphical transformations. The list of input files and the naming rules to use for your output files are specified in either the Batch List or Batch Automation dialogs. The Batch List dialog lets you define a fixed set of files that you want to transform in the same way. The Batch Automation dialog lets you define a temporary set of files that you want to process using a specific script. Complex? At first. The right thing? Yes, but it takes a bit of getting used to.
DeBabelizer provides complete online help in its own format. Many Macintosh applications provide help as balloon help, which is always cute but often useless, or external DocMaker or HTML files, which are better than nothing but can be inconvenient to use while you're actually running an application. DeBabelizer provides complete online help in its own format. All DeBabelizer dialogs contain a Help icon (a question mark) that automatically jumps to the relevant section of the help file for that dialog. You will definitely find this useful.
Creating DeBabelizer Scripts
Creating a script to process one or more images is easy. You first open an image that is characteristic of the set, then open DeBabelizer's Script window by selecting the Window menu's Script command or by clicking on the Script Window icon in the toolbar (the fifth icon from the left). The Script window, shown in Figure 1, enables you to define the sequence of transformations that you want to apply to a set of graphics files.
When creating a script, you will usually want to open a sample image from the set that you want to process with the script that you're creating. Why open a graphics file first? Because, as mentioned previously, scripts define a sequence of transformations that you will apply in batch mode to some number of different files. You therefore don't want your script to explicitly open a single file, but rather to be able to transform any file that you drag or drop onto the script or feed to the script as part of a batch list. Specifying the list of files to apply the script to is done using DeBabelizer's Batch Automation and Batch List dialogs, which are discussed later in this review.
Figure 1. DeBabelizer's Script Window.
The Script Window
DeBabelizer's Script window consists of three areas surrounded by handy icons for related commands. The top portion of the window displays three preview windows that let you examine your image as you apply transformations. To activate these windows, click Preview in the upper left portion of the Script window. The window at the left shows a reduced image of your entire graphic, overlaid with a green selection rectangle that lets you focus in on any portion of your graphic. To view any portion of your graphic, click and drag the selection rectangle to include the portion of the graphic that you want to view. The other two windows show a magnified image of the selected portion of your graphic before and after applying any DeBabelizer transformation. This previewing and selection feature makes it easy for you to check the effects of a transformation on different parts of your graphic without having to exit the scripting process. The fact that you automatically see a magnified selection from your image is convenient for verifying that color transformations that are important in one part of your image don't negatively affect others.
The middle section of the Script window consists of a set of menus that provide access to the DeBabelizer transformations that were initially available from the DeBabelizer menus and toolbar. When working in the Script window, you can't access either the main menus or the toolbar, so the menus are conveniently replicated here for use during the scripting process. Many scripting tools use a "remember what I do" model when creating scripts. I find DeBabelizer's scripting method, where you assemble the script in a specific scripting dialog, to be less prone to errors because this makes it more difficult to accidentally add an operation that you don't want to perform. One unfortunate aspect of the menus as provided in the script window is that, while you can scroll to submenus in standard Mac style, you can't scroll from one menu to the other without re-clicking the mouse button on the new menu you want to select. This is a minor irritation, but still takes a bit of getting used to.
The bottom section of the Script window displays the title of the current script above a Script View window that lists the specific DeBabelizer transformations and other operations in the order that they are to be performed in the script. The Script View window makes it easy for you to see what any script consists of and simplifies removing or resequencing specific operations within the script. You can imagine that DeBabelizer provides hundreds of different transformation and image manipulation operations-being able to drag and drop operations to resequence them is extremely handy-as is the quick removal of operations if you find a better way to improve a representative images.
Once the Script window displays, you will first want to assign a meaningful name to the script you're creating. To do this, click on the heading button over the Script View window. A dialog displays in which you can assign a new name to the script you are creating. By default, new scripts are named "New," followed by the date and time that they were created. This is possibly more useful than using a generic name if you forget to name a script but remember when you were working on it.
Specifying Graphics Transformations in Scripts
Image transformation and manipulations fall into two general categories. Some are atomic operations that can infer any information that they need from an image itself (such as rotation, basic trimming operations, and pre-scaled image resizing). Others are operations that require specific parameters, such as resizing an image to a specific, user-defined size, selecting a specific blur or color reduction method, and so on. Scripting operations that require no external information is easy-they simply appear in the Script View window. Scripting parameterized operations is conceptually a more complex task, since you need to be able to add those parameters to your script. Luckily, DeBabelizer makes this quite simple.
When you add an operation that requires parameters to a script, its name in the script window is preceded by a dark question mark. This indicates that DeBabelizer needs more information to complete this operation. Double-clicking on that operation displays a dialog in which you can define the options and any numeric parameters that you want to use, as shown in Figure 2.
Figure 2. Specifying Options for Parameterized Operations.
The Scale dialog requires several parameters: the operation to perform, the target width and height if you are scaling to specific pixel dimensions rather than to percentages, and the transformation method used to maximize the quality of the scaled image. To specify the values you want for whatever options are shown on the screen, just select them and click OK. If you've forgotten to complete any mandatory parameter, DeBabelizer displays an error message, indicating the parameter that you need to correct and why the current value is invalid. Once you've specified values for all mandatory parameters, clicking OK returns you to the Script View window, and a small "OK" symbol replaces the question mark, letting you know that the script step has all of the information you want.
Like all powerful programs, DeBabelizer has options on top of options, many of which you will rarely (perhaps never) use. To minimize DeBabelizer's intimidation factor, the authors have thoughtfully grouped the most common options on the primary dialogs, and made the more advanced options available only if you click the More button on any screen that provides advanced operations. Figure 3 shows the same dialog as in Figure 2, but after clicking More to expose additional options. In this case, the Dither Indexed Color Images and Anti-Alias options are both considered advanced options. If you want to provide values for any advanced options, just set them and click OK while the advanced options are displayed. DeBabelizer remembers that the dialog shows more options, and automatically sets them when running that step of the script.
Figure 3. Advanced Options for the Scale Dialog.
Missing Transformation Warnings
While DeBabelizer prompts you for all of the information necessary to complete a specific transformation, there are cases when subsequent steps in your script will require transformations that you may not have included in your script. For example, in my testing I found that saving graphics in output formats that have specific color limitations generates a warning message if your script doesn't specifically include a color reduction step. The example developed in this review creates a script that accepts input files with unknown numbers of colors and saves them, after transformation, as 256-color TIFF files. Figure 4 shows the warning message generated by DeBabelizer by the Save step when my script didn't include an explicit color reduction command.
Figure 4. A Sample Warning Dialog for Missing Transformations.
Not recognizing a missing step when creating a script isn't necessarily a flaw-it would be incredibly time-consuming (and probably irritating for the user) for DeBabelizer to analyze the relationship between each step and its successor as you create your scripts. DeBabelizer's compromise solution, warning you when a subsequent step requires an operation that isn't explicitly part of the script, provides a good balance between expediting the script creation process and making sure that your script contains all of the mandatory transformations.
When a missing step is detected, warning dialogs such as the one shown in Figure 4 include the option for DeBabelizer to automatically perform this step in the future, eliminating the warning and the dialog. Unfortunately, accepting this automatic remapping seems to be a global Boolean - when I tried rerunning other versions of the same script that I had saved prior to accepting this value, they automatically did the color remapping, too. This is probably the right thing in some sense, but was unexpected.
In general, when DeBabelizer displays a missing step warning, the right thing to do is to add the specific DeBabelizer commands to your script to explicitly perform the missing operation. Though DeBabelizer will fill in the blanks for you, doing so makes for hard-to-maintain scripts that reek of magic, because all of the operations they perform aren't explicitly listed.
Saving Converted Graphics Files
If you are creating a script that you will use by dragging and dropping images onto it, the final step in a your script is to save the transformed graphics file. If you are creating a DeBabelizer script that you will apply to a batch of files, the automatic output file naming options discussed in the next section of this review are built into the Batch List dialog.
Unless you have more skill (or ego) than any supreme deity gave the rest of us, you will always want to preserve your original graphics until you're positive that the transformed graphics are suitable for your purposes. Verifying your images in another graphics tool, layout tool, or over the web can take some time, but only the foolhardy or the incredibly lucky tend to skip this step. Saving your modified graphics while preserving the original files is an interesting proposition, since the only file name that DeBabelizer knows is the name of the file that you originally opened in the tool. As you'd expect, DeBabelizer addresses this "problem" in a powerful, flexible way via the naming options provided on its Save As dialog.
Figure 5. Standard Options on the Save As Dialog.
As shown in Figure 5, the standard Save As dialog provides an easy way of guaranteeing that you don't overwrite your original files with the transformed versions: by saving them to a different directory. The Save As dialog lets you navigate to or create any other folder and specify that folder as the location to save the transformed files. This would suffice, but isn't necessarily a very elegant solution.
DeBabelizer provides more sophisticated output file naming options in the more advanced version of the Save As dialog, available by clicking More. The resulting dialog is shown in Figure 6. The more advanced Save As dialog adds output options for applying another DeBabelizer script as part of the save process, automatically generating a picture icon for the saved graphics file, and provides access to a sophisticated Auto Naming dialog with more bells and whistles than the cathedral at Chartres. The Auto Naming dialog is shown in Figure 7.
Figure 6. Advanced Options on the Save As Dialog.
DeBabelizer's Auto Naming Dialog
DeBabelizer's Auto Naming dialog provides three basic naming mechanisms for transformed files: based on a user-specified text string, based on the original name of the file, or using a combination of predefined variables and information about the file itself. The first two options are fairly straightforward, but the third option deserves a closer look.
Figure 7. Save As Options for Automatic File Naming.
I use DeBabelizer on my Mac to clean up and transform images from a variety of different systems including the BeOS, Windows, Macs, and multiple flavors of UNIX. I usually need to standardize their dimensions, color depths, and output formats for use in documentation and Web publishing projects. Because I don't always have easy access to the systems on which I generated screen shots, I can't take the chance of overwriting files, though I like to keep everything in single, per-project directories. Even though the Mac doesn't require them, I like to use filename extensions to quickly identify the type of a specific graphics file. The Auto Naming dialog's Build name + extension for Save Type command does exactly what I need, letting me append the string "converted_" to the beginning of each output file, use the original file name as the remainder of the file's basename, and then append an extension that indicates the graphics output format. For example, the TIFF version of a processed BMP graphics file called screen1 would be named converted_screen1.TIF.
Testing DeBabelizer Scripts
After completing your scripts but before saving them, you may want to run through the entire script, either running the entire script at once or single stepping through each of its operations. To test a script on a sample graphics file, all you have to do is make sure that you've saved the script and then just drag a graphics file onto the circular icon at the bottom of the Script window.
Testing a script is one of the cases in which the different ways of using DeBabelizer makes things a bit more complex. For example, if you are creating a script that you will run on a list of files specified by a Batch List, your script won't include a Save step. You therefore won't be able to test the Auto Naming options until you run the script itself from the Batch List or Batch Automation dialogs.
Saving Your DeBabelizer Scripts
The final step in completing a script is saving the script itself, which is a step in which DeBabelizer still has some room for improvement. DeBabelizer doesn't seem to save scripts in the Mac file system as independent files, but tracks and stores them internally. I would find it more useful to be able to save scripts in the file system as standalone objects whose creator is DeBabelizer and which you could therefore execute by double-clicking on them. I'll discuss running scripts and specifying input file a bit later. For now, let's focus on saving the scripts in DeBabelizer's internal format.
DeBabelizer provides two options for saving scripts, Save (as current name) and Save As (under a new name). Both of these are accessed from the Script window, by clicking on the Save icon (the disk icon second from the top left in the Script dialog). To save the file under a different name, hold down the Option key when clicking on the Save icon and enter the new name for the script in the dialog that displays.
Creating Batch Lists
Batch lists are sets of files that you can define and subsequently apply specific scripts or other transformations to. Figure 8 shows DeBabelizer's Batch List dialog.
Figure 8. The Batch List Dialog.
To create a batch list and define the sets of files in that list, select the Batch List icon from the DeBabelizer toolbar (fourth from left). The Batch List dialogs displays. Click the top left icon to start a New batch List, or select an existing batch list from the list at the top of the window. To add files to a new or existing dialog, clicking the Add Files icon (third from top left) displays a dialog in which you can browse to any location and add files by clicking the Batchlist+ button. You can even add URLs rather than local file locations by clicking the Add URL button (fourth from top left). Once you're done creating a batch list, you can save it by clicking the Save icon, or modify specific options for the batch list, such as its output file naming conventions, using the icons at the bottom of the Batch List window.
Running DeBabelizer Scripts
As mentioned previously, DeBabelizer saves scripts internally rather than in the Mac file system. The way in which you run your DeBabelizer scripts depends on the type of script you've created. As mentioned earlier, there are three basic ways of using DeBabelizer: interactively; through scripts that you use via drag and drop; or through scripts that you invoke against sets of files specified either as a fixed Batch List or interactively through the Batch Automation dialog. Only the latter two options are relevant to using scripts.
To run a script that you've created to be used through drag and drop, open the Script window, select the script you want to run, browse to a file that you want to process, and drag it onto the small, round icon at the bottom of the Script window.
To run a script that you've designed to be used with batch files, you display the Batch Automation dialog by selecting that command from the Batch menu. You can also open this window from the Batch List dialog, by option-clicking on the Batch Catalog icon at the bottom. The Batch Automation dialog, shown in Figure 9, provides access to batch lists, but also lets you interactively select specific files (or all files in a specified directory) to process using a given DeBabelizer script.
Figure 9. The Batch Automation Dialog.
Once the Batch Automation dialog displays, you specify the files, folder, or batch lists you want to process using the options at the top of the dialog. You then select the script that you want to use to process those files, and select the directory in which to save the transformed files and the Auto Naming conventions to use when saving those files. You can then click Apply to execute the selected scripts on the specified files, lists, or folder contents, or can click the Exit with settings button to keep the files, script, and output options you've specified without actually executing the script.
New Features in DeBabelizer 3
DeBabelizer has been the premiere graphics tweaking and conversion application for the Macintosh for years. Version 3 improves the DeBabelizer GUI and command structure, but still leaves plenty of room for improvement in subsequent versions. Version 3 also introduces support for a few new input and output graphics formats, adds improved support for optimizing web graphics, and improves DeBabelizer's color reduction process (already superior). It also provides bidirectional CMYK to RBG conversion, and improves DeBabelizer's scripting language by adding several conditional image processing commands.
Though it's marketed as an "automated graphics [file] processor," if I were the marketing guru at Equilibrium, I would market DeBabelizer as a Swiss Army knife for anyone who ever works with computer graphics, regardless of the platform. Equilibrium has ported DeBabelizer to the Windows platform, which is almost a shame-for years, I've enjoyed being able to tell my clients that "I used a Mac" as my sole response when asked how I performed some feat of graphics conversion or manipulation wizardry. CMGI, Inc. is in the process of acquiring Equilibrium as I write this, which should only help popularize DeBabelizer by increasing its advertising budget and exposure.
DeBabelizer's interface is much improved over previous versions, but is still complex and quirky. However, reaching your goal-in this case, high-quality image manipulation, transformation, resizing, and format conversion-makes any hassles encountered en route seem minimal when you look back.
Bill von Hagen is a writer, computer system administrator, and the author of "SGML for Dummies." You can contact him at firstname.lastname@example.org.