Preparing your image files for the internet

When preparing your files for the internet you need to consider various trade offs. Since many users still have dialup connections, this means that there still is a trade off between image quality and file size. The following is a short list of things that you need to consider in relation to image file size.

For image dimensions greater than the largest thumbnail size of 256 by 256 with a jpeg image quality setting of medium or above then storing the copyright and other information is not going to add that much more to the image file size.

As well as setting the copyright in the exif information of the image file, you may also want to apply a watermark to stop the image from being used by others for commerical purposes.

To protect your copyright it may by sensible to add a company or personal logo to each image file, and you may want to add some text, perhaps a url of your website where they can purchase the original.

iMagine Photo can export image files in various graphic formats, however because these scripts are aimed at preparing digital pictures for the internet then the scripts on this page only export image files as jpeg.

iMagine Photo has two ways of controlling the image quality/file size trade off. You can specify the desired image quality (minimum/ low/ medium/ high/ maximum/ lossless) or you can specify the maximum file size of the final image. The latter can be problematic and should only be used in an automated environment after you have tried it out on a variety of different images at the image dimensions that you will be producing. Too small a file size and some of your images could look bad, too large and you may not be getting much of an improvement in image quality for the extra file size. For further information on controlling the exported image quality see page Exporting Graphics.

The following script allows to choose a file and a quality setting to save the file as. The script saves the file to the desktop, opens the saved picture in a new window and then moves the new file to the trash can.

On Panther the script can be opened in a new Script Editor window by clicking here.

on run
  
tell application "iMagine Photo"
    
set thisFile to choose file with prompt "Choose your image file: "
    
set theList to {minimum, low, medium, high, maximum, lossless}
    
set stringList to {"minimum", "low", "medium", "high", "maximum", "lossless"}
    
set theResult to choose from list stringList with prompt "Select the quality setting to save your image file as: "
    
if theResult is equal to false then
      
return
    
end if
    
set itemIndex to 0
    
repeat with i from 1 to the count of stringList
      
if (item i of stringList) is equal to (item 1 of theResult) then
        
set itemIndex to i
        
exit repeat
      
end if
    
end repeat
    
set thisImporter to import graphic thisFile
    
if the component error of thisImporter is not equal to 0 then
      
close thisImporter
      
return
    
end if
    
tell thisImporter to make exporter with properties {export file type:"JPEG"}
    
set the export folder location of thisImporter to (path to desktop folder) as alias
    
set the export file name of thisImporter to "TestFileName.jpg"
    
set the export compression quality of thisImporter to (item itemIndex of theList)
    
export thisImporter
    
set theFile to the export file location of thisImporter
    
close thisImporter
  
end tell

  
tell application "Finder"
    
open theFile
    
move theFile to the trash
  
end tell
end run

There are two ways to control the image dimensions. You can scale the image or your can specify the final image dimensions. Scaling the image is easiest, but if your original images are different sizes and you want your final images to have the same dimensions then it may be necessary to specify the image dimensions.

When specifying the final image dimensions you will need to decide whether you want to crop the original image, add a border or stretch the final image. This is necessary because it is unlikely that the ratio of the width of your images versus the height is going to be exactly the same as the final image dimensions that you specify. If you decide to add a border then you will also need to choose the border color. iMagine Photo when not running as a background only application can display a color chooser window which returns the color value.

Script 1 called AllSingingAllDancingDroplet does pretty much everything that you might want when preparing your image files for the internet. Unfortunately all that functionality comes at a price, and the price is a large number of dialogs to configure the script. To configure the script you just double click on it and each option is presented to you in a series of dialogs. Some more specific options can only be modified by editing the script. A small section near the beginning of the script is marked out for those options that can be modified this way. Editing the script will require that the script is reconfigured by double clicking it on after editing.

Script 1 for "iMagine Photo"

The ability to open scripts in a new Script Editor window is provided by an application called "Convert Script to Markup Code" and can be obtained from http://homepage.mac.com/jonn8/as/

keywords: AppleScript, Apple Script, jpeg, jpg, image processing, graphic, graphics, images, Macintosh, internet