Creating Script Files
A Multiple Image Resizer .NET script file is essentially a text file containing a list of image processing functions that you would like to apply to a set of images.
General Scripting Rules
- Multiple Image Resizer .NET script is case insensitive
- Each script function must be placed on a separate line in the script file
- Each comment line must be place on a separate line in the script file
Script files should be created using a text editor (e.g. Notepad). When you have finished creating your script file in your chosen text editor you should save it, and then tell the Multiple Image Resizer .NET script file parser to check the script file for errors (see Validating Script Files).
Below are some simple script file examples, with comments to tell you what the script function is doing (note a comment line is in Green and a script function line is in Blue):
Example 1 - Resize images to 800x600 and specify the processed images should be saved as JPEG files in a single folder named "processed" on the C drive:
' Resize images to 800x600
Resize 800, 600
' Save images as JPEG's at 100% quality to "c:\processed"
SaveToFolderJpeg "c:\processed", 100, False
Example 2 - Resize images to 1004x748, add a 20 pixel border to each edge of the image in red, and specify that processed images should be saved as BMP files in a single folder named "processed" on the C drive:
' Resize images to 1004x748
Resize 1024, 748
' Create a solid fill in red to use as the border color
CreateFillSolid "myBorderFill", Argb(255, 255, 0, 0)
' Add a 20 pixel border around each image
AddBorder "myBorderFill", 20, 20, 20, 20
' Save images as BMP's to "c:\processed"
SaveToFolder "c:\processed" , bmp
Example 3 - Adds some text to the bottom right corner of each image (offset 10 pixels in from bottom right corner), the text is filled with a gradient fill. It then specifies that images should be saved to a sub folder named "processed" beneath each original image locations in GIF format:
' Create the font to use for the text
CreateFont "myFont", "Arial", Bold, False, False, 20
' Create the gradient fill used when applying the text
CreateFillLinearGradient "myGradientFill", Argb(255, 128, 128, 40), Argb(255, 255, 38, 68), 45
' Add the text to the bottom right corner of each image offset by 10 pixels
AddTextByPosition "Image processed by Multiple Image Resizer .NET", "myFont", "myGradientFill", Horizontal, BottomRight, 10, 10
' Save images as GIF's to the "processed" sub folder under original image
SaveToSubFolder "processed", gif
Script files can obviously be more complex than the examples shown above. You can specify as many or as few script functions in a script file as you like, but remember to specify one of the Save functions at the bottom of your script file or you processed image files will not be saved!
For a full list of the image processing functions supported in Multiple Image Resizer .NET script see image processing functions reference.