Not all these parameters are appropriate for all file types - or can be done by all exporters - so they must be regarded as hints.



This determines the quality of an image when performing a lossy compression (e.g. for JPEG or SWF). You can provide a numeric value between 0.0 and 100.0 or one of the following predefined values:

  • "lossless" equivalent 100.0
  • "max" equivalent 99.9
  • "high" equivalent 75.0
  • "normal" equivalent 50.0
  • "low" equivalent 25.0
  • "min" equivalent 0.0

If no quality is provided the parameter defaults to Normal quality.

The following code exports three image files at different qualities.

mycanvas.SaveAs Server.MapPath("hires.jpg"), "Quality=high"
mycanvas.SaveAs Server.MapPath("lores.jpg"), "Quality=low"
mycanvas.SaveAs Server.MapPath("medres.jpg"), "Quality=50.0"


Some images can be exported in a color depth different from that of the Canvas. This parameter allows you to override the default color depth - that of the Canvas.

Unlike the canvas depth this value can accept any number or "thousands" or "millions". So for file formats such as GIF you can define a precise number of colors that are required.

Note: The depth is a hint rather than a command. Depending on the way that color reduction is performed it may result in a different number of colors in the final image. See the palette parameter for details.

Note: Due to the way that run-length GIF encoding works, reducing the depth of GIF images does not decrease their file size.



When images are exported at a different color depth there are different ways of choosing the colors that should be used for the image. We provide the following options for the palette parameter.

  • "Adaptive" - the default
  • "WebSafe"
  • "Windows"
  • "Macintosh"
  • "Uniform"
  • "Grayscale"
  • "Black&White"
  • "Exact"

The Adaptive palette may use fewer than the number of colors specified if there are a limited number of colors in the image. ImageGlue uses an optimised Octree algorithm for fast, high quality color reduction.

The WebSafe, Windows and Macintosh palettes all have a fixed numbers of colors. The depth parameter is ignored if you choose one of these options.

The Uniform palette specifies a set of colors uniformly distributed throughout color space. This palette only exists for 8, 27, 64, 125 and 216 colors and so the number you specify in the depth parameter may be reduced to accomodate this.

The Grayscale palette will use exactly the number of gray values specified in the depth - minimum two.

Black and White is always two colors - black and white.

The Exact palette is a kind of Adaptive palette optimized to ensure an exact color match wherever possible.

You can append colors to Exact or Adaptive palettes separated by colons or semicolons. These colors are fixed colors which will always be added to the palette. For example the following code would use a 32 color exact palette ensuring the colors black, white, red and green were present.

c.ReduceColors "exact:255,255,255;0,0,0:#FF0000:#00FF00", 32, False



When images are exported at a different color depth from that of the canvas they may be dithered. Dithering uses a scattering of pixels of different colors to approximate colors that are not available as a result of the color depth reduction. This parameter allows you to override the default dither setting - that of the canvas.

In general it is a good idea to dither images like photographs which contain smooth gradations of colors. It is best not to dither posterized images containing blocks of colors.



Some file formats, such as GIF, allow one color to be treated as transparent. Because the export process may re-map the colors on your canvas you do not specify a transparent color directly. Instead you specify a point that will be transparent and the export process will infer the color after any color mapping has been done. The default is for no transparent colors.

For example the following exports a transparent GIF taking the color at the top left as the transparency.

mycanvas.SaveAs Server.MapPath("transparent.gif"), "Transparent=0,0"

If required you can specify a color to be transparent. If color reduction is performed during export ImageGlue will attempt to match up the transparent color with the new color depth of the image. However you should be aware that for certain depths this is not always possible.

For example the following exports a transparent GIF with white the transparent color.

mycanvas.SaveAs Server.MapPath("transparent.gif"), "Transparent=#ffffff"



Some file formats allow images to be exported in an interlaced form. GIF is the most common example of this. If the file format allows it the interlace parameter can be used to specify that this should be done. The default is false.

For example the following exports an interlaced GIF.

mycanvas.SaveAs Server.MapPath("interlace.gif"), "Interlace=true"



Some file formats, such as PNG, allow an alpha channel to be exported to provide transparency. If you want an alpha channel in your saved image this value must be set to true (by default it is false). The alpha channel is derived from the alpha values in the canvas you are exporting.



Some file types support images coded at different number of dots per inch (dpi). By using this parameter you can choose a different horizontal dpi setting for the exported image.



This specifies the vertical number of dpi for the exported image.



The ICC color profile to be used when exporting as CMYK TIFF or JPEG. This profile is used to convert the base image into CMYK and is also embedded in the output to ensure color independence.

To export as CMYK you need to set the ColorSpace parameter to CMYK.

canv.SaveAs "c:image.jpg", "colorspace=cmyk colorprofile='c:\cmyk.icm'"