iMagine Photo version 2.1 adds the ability to add icons to image files, the documentation for this is near the end of the exporting graphics documentation. Also added is the ability to fix hot pixels and this is described in the Pixel Mapping hot pixels documentation section. The ability to turn off gamma and colour correction when drawing from a graphic importer has also been added and this is described near the end of the Importing graphics documentation section.
iMagine Photo is an application that provides significant functionality to AppleScript for processing image files and movie frames.
You can scale, crop, and rotate image files and movie frames.
You can blend images including taking advantage of the transparency information stored within images. You can create new image files, including new image files with transparency information stored in them.
You can draw shapes and text, and combine the results of your drawing with image files. You can also apply quicktime filter effects.
You can add and remove exif information from image files, including properties like copyright, author and caption. See the Read/Write Exif metadata section for details.
You can map bad pixels produced by your digital camera. These pixels are often known as hot pixels because they show themselves as bright spots in your image. iMagine Photo can remove these bad pixels by using bilinear interpolation and a list of the mapped bad pixels.
iMagine Photo provides 6 different types of objects for processing images and movies.
There is the graphics importer which imports image files. A graphic importer can create a graphic exporter and export images via the graphics exporter and/or the graphics importer can draw to a graphic or window document.
There is the graphics exporter object which belongs to its containing object, either a graphics importer or a graphic or window document. The graphics exporter does the work of creating image files. A graphics exporter object is created automatically whenever a graphic or window document is created. The graphics importer does not create a graphics exporter automatically but has a single command that can be used to create and configure a graphics exporter.
There is the movie importer. The movie importer is similar in behaviour to a graphics importer except that it can't create an exporter or export movie frames directly. The movie importer can draw to a graphic or window document.
There is the graphic document. The graphics document is where all the drawing takes place, either graphics, movies, shape and text drawing, or applying of quicktime filter effects.
There is the window document which is a graphic document with a window. In all the example scripts a window document is used to demonstrate the features of iMagine Photo. It is however more efficient to use a graphic document. See the Graphic/Window Document section to see how to create a graphic document instead of a window document.
There is the movie editor which allows you to create movies and add frames using a range of different codecs.
iMagine Photo provides a number of commands at the application level. iMagine Photo can be configured to run in the background. After this property is set the next time that iMagine Photo runs it will run in the background. The following line will cause iMagine Photo to run in the background after it is restarted:
set run in background to true
You can find out whether iMagine Photo is running in the background
set isBackground to run in background
The above line returns the current state of iMagine Photo, and does not reflect what the property might have just been set to. If iMagine Photo is running in the background you can tell iMagine Photo to run as an application next time it starts by setting run in background to false.
When an application is a background only application, there is no way to quit the application using the user interface. iMagine Photo has an option for quitting automatically after a certain period of inactivity. The property for setting the quit delay is called quit delay. iMagine Photo will not quit if any importers or graphic or window documents are open.
You can find out the current quit delay (in seconds):
set theDelay to the quit delay
You can set the quit delay
set quit delay to 10
which will set the quit delay to 10 seconds. At present iMagine Photo does not save the quit delay as a preference. It is necessary to set the quit delay each time you run if necessary. If you know you have finished using iMagine Photo, iMagine Photo will quit when you send the AppleScript quit command.
If iMagine Photo is not running as a background only application it can display a color picker floating dialog and return the result to the Apple Script. The following command displays the dialog and returns the value:
set theColor to pick color
When exporting image files, quicktime provides a number of different graphic formats that you can export your image as. To find out what graphic formats are available, you can use the available exporter types. This command returns a list of graphic exporter types.
set theTypes to the available exporter types
Any item in the list can be used to create a graphic exporter with or to set the export file type of a graphic exporter. There is also the get text dimensions command which is described in Drawing Text documentation section.
For more detailed documentation see the relevant pages where you will find lots of sample AppleScripts that you can run.
keywords: AppleScript, Apple Script, Quicktime, movie, Macintosh.