Colorsync

iMagine Photo's colorsync functionality is limited. I have struggled to get my head around colorsync and none of my questions on Apple's colorsync mailing list have been answered.

iMagine Photo has three areas where colorsync support has some functionality. There is a colorsync composition element which allows you to apply a colorsync operation to an area of a graphic or window document. By default the area is the whole of the graphic or window document. A colorsync profile in one image file can be copied to a graphic exporter where it will be added to the image file. Thirdly colorsync can be turned off when drawing from a graphic importer.

The following script creates a colorsync composition element which is applied to the whole of the graphic document. On my powerbook I can see a small color shift in the blue when the color profile is applied. Panther users can open this script in a new Script Editor window click here.

on run
  
tell application "iMagine Photo"
    
set thisDocument to make new window document with properties {dimensions:{400, 300}}
    
tell thisDocument to create composition element with properties {class:filled rectangle, bounds rectangle:{0, 0, 400, 300}, color:{10000, 10000, 32000}}
display dialog "Click ok to apply the profile: "
    
tell thisDocument to create composition element with properties {class:color sync, source profile name:"sRGB Profile", destination profile name:"Generic RGB Profile", matching option:perceptual photos}
  
end tell
end
run

To view all the Colorsync profiles installed on your Macintosh run the ColorSync Utility application which can be found in the Utilities folder of your Applications folder.

The possible matching options are: perceptual photos, relative colorimetric logos, saturation graphics, and absolute colorimetric logos.

The other area where colorsync support is implemented is in the graphic exporter. The graphic exporter can copy a colorsync profile which is contained in a image file and add it to the image file that it will create or replace the contents of when the graphic exporter creates the new file. When a color profile is proprietary quicktime does not copy the profile. This seems to be quite common. The following script copies the the color profile to the new image file and adds exif info to the image file. Panther users can open this script in a new Script Editor window click here.

on run
  
set thisFile to choose file with prompt "Choose an image file with a profile: "
  
set newFile to choose file name "Choose a name and location with the copied file: " default name "ImageFileWithCopiedProfile.jpg"
  
set imageInfo to text returned of (display dialog "Enter the exif headline information that you would like to add to your image file: " default answer "This is my fantastic photo: ")
  
tell application "iMagine Photo"
    
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
    
set the export exif user data of thisImporter to thisFile
    
set the export exif data of thisImporter to {{exif type:info, exif unicode:imageInfo}}
    
set the export icc profile of thisImporter to thisFile
    
set the export file location of thisImporter to newFile
    
export thisImporter
    close thisImporter
  
end tell
end run

Since iMagine Photo's functionality is limited, the export icc profile property allows you to copy the color profile from the original file into the processed file, so that you don't lose the color profile information. Apple's ColorSync Scripting addition can color match your image before being processed by iMagine Photo. In Script Editor you can open the AppleScript dictionary for ColorSyncScripting from the Open Dictionary menu item in the File Menu. If you want to know more about how to use ColorSync Scripting then I am sure that the good people on the macscripter forums bbs.macscripter.net will be able to help out.

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, color sync, Macintosh, Mac, Quicktime, colorsync