Syntax
Comments
Any text on a line that follows a #
character is ignored, and can be used for commenting purposes
Frames
Frames must always begin with their name followed by a colon, and an empty line following the last layer.
#Frame starts with a name
AFrame:
"image"
#Frame is now finished
If the frame's name is prefixed by a !
character then it will not be generated as output, but may still be used as a reference within the DrawDown file.
Layers
Each frame should contain one or more layers. Layers typically start with a resource reference which can be an image in the source path (by default the location of the DrawDown file) or a previously defined frame.
Frame1:
"background"
Frame2:
"Frame1"
"logo"
You can also flatten all previously layers by adding 4 or more -
characters instead of a resource reference. This will flatten all layers above it and can be useful when you do not want to create an intermediate frame. They can be followed by any of the normal processing commands.
Frame:
"background"
"logo"
------------ 512x512 #Resize the combined layers to 512x512
Processing Commands
Processing commands are specified after the resource reference in a layer
Translate - x,y
Move the resource by the specified x and y co-ordinates
Frame:
"logo" 50,50 #Move the logo 50 across and 50 up
Resize - widthxheight
Resize the resource to the specified width and height
Frame:
"logo" 50x50 #Resize the logo to 50 by 50 pixels
Scale - factorx
Resizes the current resource by the specified factor
Frame:
"logo" 3.5x
Colorize - $RRGGBB
Apply the specified color (given as hexadecimal RGB bytes) to the resource
Frame:
"background" $6688FF #Tint the background blue
Opacity - opacity%
Make the layer transparent by the specified amount
Frame:
"logo" 50% #Draw the logo at 50% opacity
Rotate - Ødeg
Rotate the layer by the specified amount
Frame:
"logo" 35deg #Draw the logo at an angle of 35 degrees
Trim - ||
Trims transparent pixels around the resource. This can be particularly useful after rotating a resource.
Frame:
"logo" || #Trim transparent pixels from around the resource
Crop - |x,y widthxheight|
Crops the layer starting at x,y to the size widthxheight
Frame:
"logo" |512,512 512x512| #Crop to just the top right-hand quadrant
Mask - |resource|
Scales the supplied resource to the same size as the current frame, and then masks the flattened current frame with that mask
Frame:
"background" |mask-image|
Defines
It is common to want to specify a value once and re-use it through out a Drawdown file. Define instructions enable you do this. For example to specify and then use DrawDown blue you might do the following:
<define:DrawDownBlue=6688FF>
AppIcon:
"background" $(DrawDownBlue) #Use DrawDown blue
"logo" 35deg 50,50 #Add the logo
Specifying a constant -
Defines a constant that can be used subsequently in the DrawDown file. The value can be any string, and a direct text substitution is performed
<define:DrawDownBlue=6688FF>
Using a constant - (key)
Will replaced with the value of key
<define:DrawDownBlue=6688FF>
AppIcon:
"background" $(DrawDownBlue) #Equivalent to "background" $6688FF
Special Defines
There are a small number of reserved constants that control the behaviour of the DrawDown processor. These are supported by command line parameters for the command line tool, and the user interface in the MacOS app, but in either case will be overridden if defined in the body of a DrawDown file.
path
Specify the path for source images.
<define:path=~/Pictures/> #Use the user's Pictures directory to search for resources specified in layers
output
Specify the path frames should be saved to. For the command line app this defaults to the directory the DrawDown file is in, for the MacOS app it will use the path specified when Build All is executed.
<define:output=~/Desktop/> #Save frames to the specified location
format
Specify the default format to save frames as. This can be png,gif,bmp,jpg,tiff,ice, or icns. It defaults to png.
<define:format=jpg> #Save frames as jpg files
resize
Specifies the method used for resizing. It defaults to fast
which uses a nearest neighbour algorithm. Setting it to smooth
will apply a linear filter.
<define:resize=smooth> #Resize using a linear filter
guide
Specifies that guidelines should be drawn, intersecting at the specified coordinates. This only applies to the MacOS app.
<define:guide=50,50> #Draw guide lines intersecting at 50,50