advert

Automating Graphics Processing

Let the software take the strain - automating graphics processing

Repetitive tasks

If you ever work with image files, you may find yourself repeating the same task time and time again.

Here's a good example - to publish images on AOL, we at Practical PC typically create the original image either with a digital camera in the case of an item of hardware, or more often, by taking a snap of the computer screen using a tool such as HyperSnap-DX.

The format and resolution of the original file can vary but AOL needs a file in a format called Graphical Interchange Format or GIF. GIF files support 8-bit (256) colour. There are two versions of GIF: 89a, which can save transparency and animation information, and 87a, which cannot. Both are recognized by most browsers and use lossless compression so there's no degradation of your image. Furthermore, to allow images to load quickly, they must not exceed 220 pixels or dots wide.

The challenge

So the challenge for this example is to take image files through the following process:

Step 1 - Resize to 220 pixels wide, keeping the vertical dimension in proportion to maintain the shape or aspect ratio of the image.

Step 2 - Save as GIF89a ready for web publishing.

No doubt your own requirements will be different, but the general principles still apply.

Although there are many image processing tools on the market, few allow you to automate processing but here are two that do.

The tools

Two tools that support a range of conversion features are JASC Image Robot (from publishers of Paint Shop Pro) and Macromedia Fireworks. Here's how to convert using each of these tools.

JASC Image Robot

Image Robot - lots of commands.Image Robot is a basic utility to automate file conversions. You'll need a graphics viewer or editor such as its stablemate, Paint Shop Pro or ThumbsPlus to view the work properly although if you are desperate, you can use your web browser.

Here's how to use Image Robot to run the example conversion:

  1. Select Change to 256 colours (8 bit) from the list of Available Commands
  2. Select Add Command to Script to display a list of options for this command.
  3. Select OK to save this command
  4. Select Resize/Resample Image from the list of Available Commands
  5. Select Add Command to Script to display a list of options for this command.
  6. Select Use width and maintain aspect and set width to 220 pixels with method set to Resize or resample.
  7. Select OK to save this command.
  8. Select Set Output Options from the list of Available Commands.
  9. Select File format type to GIF and Subtype to 89a Interlaced.
  10. Select Browse and choose an appropriate folder.
  11. Select Start and select the files you wish to convert.

You can save the scripts for later reuse. To do this, use the Save As command from the Script menu.

Image Robot has dozens of different batch operations so is well worth a look. It costs $89 to purchase from www.jasc.com.

Macromedia FireworksMacromedia Fireworks

Fireworks is a fully specified graphics tool for creating and editing images destined for the web. Although self-contained, it is optimised for use with Dreamweaver, one of the top professional web design applications. Here's how to perform the above task in Fireworks.

First create the script

  1. Select Batch process from the File menu.
  2. Select Next to display the Batch window.
  3. Select Scale, then Add.
  4. In the lower half of the Batch window, select Scale to size and set the size to 220 pixels horizontally. You'll need to type 220 into the field as it's not one of the options presented. Select Variable in the vertical field.
  5. Select Export, then Add.
  6. From the list of file formats, select GIF Websnap 256.
  7. Select Next.
  8. Select Save to save your script. (Note that if you save your script file into Fireworks' Command folder then they will be easier to find later.)
  9. Select Cancel. Next, open the files to process
  10. Select Open Files from the File menu and select each file to open. Then run the script
  11. Select Run Script from the File menu (or if you saved your script file into Fireworks' Command folder it will appear as an entry in the Command menu.)
  12. Select the script (it'll be a .jsf file)
  13. Select OK

Batch progressEach file will now be processed and then moved to a subfolder called 'Original Files.'

A big strength of Fireworks is that the script files are created in Javascript so if you are feeling adventurous you can edit the script file to change its function. For example, this is the script created above. You can download a demo version of Fireworks from www.macromedia.com but be warned: it's a big download.

 

Don Bradbury

Keep up to Date with PPC

RSS feed icon

Add to Google

Free Sitemap Generator