Peter’s Programming Notes: Scripted Image Drawing

Scripted Image Drawing

The question of how best to drawings (graphs, charts, images, text layouts, etc) from scripts (AppleScript, Perl, Python) on Mac OS X comes up fairly regularly, and there are lots of options. The correct solution depends very much on the problem.

I have started to put together the following summary. Many of the packages I have never used, so if you have anything to add or correct about any of these packages, please let me know.

The list below is in alphabetical order.

Contents

Comparison Table

Tool Import
PDF
Import
Image
Export
PDF
Export
Image
Text Drawing
Primitives
Image
Primitives
AppleScript 1 Perl 1 Python 1
Adobe SVG Viewer ? ? N/A N/A Yes Yes Yes Yes2 Yes2 Yes2
AppleScript Studio A framework that can use AppleScriptable tools Yes No No
CamelBones A framework that can use Cocoa facilities No Yes No
DrawBot Yes Yes Yes Yes Mac Yes Yes No No Yes
GD No Some No Some Bitmap/TrueType Yes Yes No Yes Yes
GraphicConverter Yes Yes Image Yes Yes Yes Yes Yes No No
gnuplot ? ? ? ? ? ? ? ? ? ?
Image Events Yes Yes Image Yes No No Yes Yes No No
ImageMagick Yes Yes Image Yes TrueType Yes Yes No Yes Yes
Imager No Some No Some Non-Mac Yes Yes No Yes No
iMagine Photo Yes Yes No Yes Mac Yes Yes Yes No No
Matplotlib ? ? ? ? ? ? ? ? ? ?
NodeBox Yes Yes Yes Yes Mac Yes Yes No No Yes
OmniGraffle Yes Yes Yes Yes Mac Yes Yes Yes No No
PhotoShop Yes Yes Image Yes Mac Yes Yes Yes No No
PyObjC A framework that can use Cocoa facilities No No Yes
Sketch ? ? Yes TIFF Mac Yes ? Yes No No
Smile Yes Yes Yes Yes Mac Yes Yes Yes No No
TclOSA No No Yes No Mac Yes Yes Tcl No No
  1. This refers to direct access by the language. Perl, Python can easily access AppleScript facilities through bridges
  2. Scripts generate XML and then SVG generates the image

Adobe SVG Viewer

http://www.adobe.com/svg/

AppleScript Studio

CamelBones

http://camelbones.sourceforge.net/

DrawBot

http://drawbot.com/

GD

http://www.boutell.com/gd/

GraphicConverter

http://www.graphicconverter.net/

GraphicConverter is a high-level bitmap image manipulation program.

gnuplot

http://www.gnuplot.info/

Apple Image Events

ImageMagick

http://www.imagemagick.org/

Imager

http://www.develop-help.com/imager/

iMagine Photo

http://www.yvs.eu.com/imagine.html

Matplotlib

http://matplotlib.sourceforge.net/

Matplotlib produces plots and graphs.

NodeBox

http://nodebox.net/

OmniGraffle

http://www.omnigroup.com/applications/omnigraffle/

PhotoShop

http://www.adobe.com/products/photoshop/main.html

Photoshop is a powerful high-level bitmap image manipulation program.

PyObjC

https://pythonhosted.org/pyobjc/

PyObjC provides an Objective-C bridge for Python onto the Cocoa system API. Cocoa includes low-level vector/bitmap/text drawing primitives and much more.

Sketch

/Developer/Applications/Utilities/Built Examples/Sketch.app

Smile

http://www.satimage.fr/software/en/index.html

TclOSA

http://www.aker.ca