A number of other parameters are available for image related operations. These may involve drawing Graphics Files or Data and drawing one Canvas onto another.

 

   
1
 
Type    
     

This is used to specify or override the type of image data. You can specify a type in a number of ways - you can use either a sample filename, a MIME type or the name of a Graphics Exporter. This is generally used to specify a file type or to override the default file type which would be used.

For example the following will save a jpeg out without a file extension:

[VBScript]
mycanvas.SaveAs Server.MapPath("myimage"), "Type='dummy.jpg'"


   
2
 
Image    
     

Graphic files and data may contain multiple images. If they do this parameter allows you to specify the number of the image you are interested in.

By default this is 1 which indicates the whole or composite image.

For example the following will draw the second image in a Photoshop file onto the canvas.

[VBScript]
mycanvas.DrawFile Server.MapPath("layers.psd"), "Image=2"

 

   
3
 
Time    
     

Movies do not have well defined numbers of images. Particular tracks of a movie may have numbers of frames but these may not be a constant time apart and there may be more than one such track in a movie. You specify an image within a movie by giving a number of seconds from the start.

By default the Time is zero which indicates the start of the movie.

For example the following will draw an image from a movie at a period two and a half seconds from the start.

[VBScript]
mycanvas.DrawFile Server.MapPath("sport.mov"), "Time=2.5"

 

   
4
 
Fit    
     

When you draw an image it is always drawn to fit exactly inside the rectangle you have provided. If you have a tall thin image and you draw it into a short fat rectangle then this may involve considerable distortion. By setting the fit parameter to true the rectangle will automatically be altered to minimize this distortion.

Providing the image is smaller than the rectangle it will be drawn at its natural size within the rectangle. If the object if larger than the rectangle, it will be proportionally scaled down (maintaining its original shape) to fit it within the rectangle.

The VAlign and HAlign parameters are used to align the object within the rectangle once it has been scaled as necessary.

For example the following will draw an image centered (and scaled if necessary) onto a canvas.

[VBScript]
mycanvas.DrawCanvas othercanvas.Image, "Fit = true Valign=middle HAlign=middle"

 

   
5
 
Mode    
     

The drawing mode determines how images are transferred to the Canvas. The possible options are:

  • "copy" (the default)
  • "transparent"
  • "blend"
  • "addover"
  • "addmax"
  • "addpin"
  • "subover"
  • "submin" - only available for use in selection
  • "subpin"
  • "prewhitealpha"
  • "preblackalpha"
  • "addmin"

Copy does what you might expect performing a faithful copy of the source image onto the destination area.

Transparent uses the alpha channel of the source image to combine it with the destination image. Depending on how transparent or opaque each point on the image is the two points will be blended together in varying proportions. Note that if you have not explicitly specified an alpha channel for your canvas you will probably find that it is completely transparent.

Blend is a variation on the Transparent mode that uses the ModeColor (see the parameter of the same name) to do a variable blend of the source and destination picture in conjunction with the alpha channel.

The add and sub modes add together or subtract the component brightnesses of each of the corresponding points in the image. The different variants of the add and subtract modes deal with what happens to brightness' once they go over 100% or under 0%. The over modes do a rotation: 70% plus 70% becomes 40%, 30% minus 50% becomes 80%. The min and max modes pin the maximum value to 100% and minimum to 0%. The pin modes allow you to specify a different value to pin the maximum and minimum values to. This pin value is determined using the ModeColor (see the parameter of the same name).

Prewhitealpha and Preblackalpha are variations on the Transparent mode. Prewhitealpha pre-multiplies each pixel with a white pixel depending on its alpha value. Essentially this performs a transparent copy onto a white background. Preblackalpha does exactly the same but with a black pixel. Both may be used to reduce the amount of 'jaggyness' around the edges of objects.

For example the following draws one canvas transparently onto another:

[VBScript]
mycanvas.DrawCanvas myothercanvas.Image, "Mode=transparent"

The addmin mode is an exception to the rules specified above. It inserts the minimum of the component brightness' of each of the corresponding points in the image.

   
6
 
ModeColor    
     

This color is used in some drawing modes as a parameter. It is specified just like any other color.

For example the following draws one canvas blended 50% into another:

[VBScript]
mycanvas.DrawCanvas myothercanvas.Image, "Mode=blend ModeColor=50,50,50"

 

   
7
 
SourceRectangle or SrcRect    
     

When you are drawing an image into a Canvas ImageGlue assumes that you want to draw the whole of that image. But sometimes you may want to draw only a small part of the image. You can use this parameter to specify the part of the image you would like drawn.

For example the following draws a ten pixel square out of one canvas onto another:

[VBScript]
mycanvas.DrawCanvas myothercanvas.Image, "SrcRect=10,10,20,20"

 

   
8
 
Interpolation    
     

When images need to be resized or transformed ImageGlue chooses an appropriate type of resize algorithm to produce the highest quality result in the shortest possible time. Under certain circumstances you may prefer to override the automatic choice of algorithm.

The possible options are:

  • "auto" (the default)
  • "nearest" (nearest neighbor)
  • "linear" (linear interpolation)
  • "cubic" (cubic interpolation)
  • "super" (super-sampling)

Note that this parameter is ignored if the IPL parameter is set to false.

For example the following will fit an image to a canvas using a cubic interpolation algorithm.

[VBScript]
mypath = Server.MapPath("/mypic.gif")
mycanvas.DrawFile mypath, "Fit=true interpolation=cubic"

 

   
9
 
EdgeSmoothing    
     

When images are transformed in certain ways ImageGlue may automatically choose smooth the edges of the image to prevent 'jaggies'. Under certain circumstances you may prefer to override this behavior.

By default this is true indicating that edges will be smoothed.

Note that this parameter is ignored if the IPL parameter is set to false.

For example the following will draw an image on a canvas without edge smoothing.

[VBScript]
mypath = Server.MapPath("/mypic.gif")
mycanvas.DrawFile mypath, "Rotate=45 edgesmoothing=false"

 

   
10
 
IPL    
     

When images need to be resized or transformed ImageGlue uses an Intel optimized Image Processing Library (IPL) for fast high quality results. However under certain conditions you may prefer to use standard GDI routines.

By default this is true indicating that the IPL will be used. This default value can itself be overridden from the IGSettings control panel.

For example the following will fit an image to a canvas without using the IPL.

[VBScript]
mypath = Server.MapPath("/mypic.gif")
mycanvas.DrawFile mypath, "Fit=true IPL=false"

 

   
11
 
Modules    
     

ImageGlue operates on a waterfall model. Processing is attempted with successive modules until one is found that supports the specific image or operation.

Using the Modules parameter you can alter which modules are used and in what order they are called when graphics are being drawn. The modules that are available are:

  • TIF - Custom TIFF Library
  • IJL - Accelerated JPEG Library
  • QTI - QuickTime Graphics Importers (if available)
  • GDI - GDI+ Graphics Importers (if available)
  • JB2 - JBIG2 Library
  • APS - Advanced PostScript Rendering Library
  • PS - PostScript & PDF Importer (if enabled)
  • EPSF - Encapsulated PostScript Preview Importer
  • IM - ImageGlue Graphics Importers
  • QTM - QuickTime Movie Importers (if available)
  • TXT - Text Rendering

The default for this parameter is:

Modules='TIF,IJL,QTI,GDI,JB2,APS,PS,EPSF,IM,QTM,TXT'

Note that this parameter is only used when drawing images and not when saving or getting information from them. Also note that if a module is disabled from IGSettings it cannot be made available using this parameter.

 

   
12
 
Res    
     

Some types of images are resolution independent. For example a PostScript file contains a set of drawing commands designed for drawing on a page. Although the physical size of the page is specified, the resolution in dots per inch (dpi) is not.

When you render a resolution independent image you can choose the resolution at which you wish your image to be rendered. Higher resolutions will result in larger images. Note that rendering at a resolution which will produce an appropriately sized image is much more efficient than rendering at a high resolution and then resizing the resulting image.

This parameter is currently used only by the EPSF/PDF Render Module. See the PostScript Handling section for more details.

The default resolution is 72 dpi.

[VBScript]
mycanvas.DrawFile Server.MapPath("zoo.pdf"), "Res=300"

 

   
13
 
Timeout    
     

Rendering some types of images can be time consuming and place a heavy load on the server. By specifying a timeout you ensure that operations will be abandoned if they take too long.

This parameter is currently used only by the EPSF/PDF Render Module. See the PostScript Handling section for more details.

The timeout is measured in seconds. The default is 45 seconds.

[VBScript]
mycanvas.DrawFile Server.MapPath("zoo.pdf"), "Timeout=10"

 

   
14
 
ColorSpace    
     

This parameter allows you to specify a color space for an image.

Vector formats like PostScript are designed to allow the precise control of colors for a specific device (e.g. a CMYK printer). If you reproduce these colors on a different device (e.g. an RGB screen) the colors may not be consistent. By specifying the color space that the image was originally intended for ImageGlue can adjust colors so that they appear correctly.

The possible options are:

  • "Undefined"
  • "CMYK"
  • "RGB"

If you specify the "Undefined" color space, ImageGlue will attempt to intelligently determine the intended color space by looking at the image being processed.

This parameter is currently used only by the EPSF/PDF Render Module. See the PostScript Handling section for more details.

The default ColorSpace is "Undefined".

[VBScript]
mycanvas.DrawFile Server.MapPath("zoo.pdf"), "ColorSpace=CMYK"

 

   
15
 
AntiAlias    
     

This parameter allows you to choose whether vector images should be rendered anti-aliased or not.

When vector images such as PostScript are rendered, lines may be drawn either normally or anti-aliased. Drawn normally a line may appear 'jaggy'. Drawn anti-aliased the line will be blurred at the edges so that it appears smooth. However anti-aliased rendering uses extra memory and places a heavier load on the server so you may wish to disable it using this parameter.

This parameter is currently used only by the EPSF/PDF Render Module. See the PostScript Handling section for more details.

Anti-aliasing defaults to true.

[VBScript]
mycanvas.DrawFile Server.MapPath("zoo.pdf"), "AntiAlias=false"

 

   
16
 
AutoRotate    
     

This parameter allows you to choose whether PDF pages should be automatically rotated in the same way that Acrobat does when it encounters a landscape page.

Auto-rotation defaults to true.

[VBScript]
mycanvas.DrawFile Server.MapPath("zoo.pdf"), "AutoRotate=false"

 

   
17
 
IccCmyk    
     

A path to the default CMYK ICC color profile.

This parameter is used only by the Advanced PostScript module when rendering EPS or PDF files. It is used to specify the profile that will be used to convert any device CMYK specified in the PDF file to the device independent working color space.

This is used when the output ColorSpace is Lab or another device independent color space such as sRGB. If the IccOutput indicates that a color profile should be used the output is always device independent. If the IccOutput indicates that no color profile should be used then the output is always device dependent.

This property can take a path to an icm file. However there are also two special values you can use. If the property takes the value "device" then the device color space will be used. If the property takes the value "standard" then a built in default color profile will be used.

If this property is set to "standard" or a path to a color profile then IccRgb, IccCmyk, IccGray and IccOutput should also be set to "standard" or paths to color profiles. All color spaces are assumed to be device independent color spaces.

If this property is set to "device" then IccRgb, IccCmyk, IccGray and IccOutput should also be set to "device". All color spaces are all assumed to be device color spaces.

If this property is set to a file name with no path information, then the folder "<windows>\system32\spool\drivers\color" will be searched to locate the file.

This parameter defaults to "standard".

[VBScript]
mycanvas.DrawFile Server.MapPath("zoo.pdf"), "IccCmyk=myprofile.icm"

 

   
17
 
IccRgb    
     

A path to the default RGB ICC color profile.

This parameter is used only by the Advanced PostScript module when rendering EPS or PDF files. It is used to specify the profile that will be used to convert any device RGB specified in the PDF file to the device independent working color space.

This is used when the output ColorSpace is Lab or another device independent color space such as sRGB. If the IccOutput indicates that a color profile should be used the output is always device independent. If the IccOutput indicates that no color profile should be used then the output is always device dependent.

This property can take a path to an icm file. However there are also two special values you can use. If the property takes the value "device" then the device color space will be used. If the property takes the value "standard" then a built in default color profile will be used.

If this property is set to "standard" or a path to a color profile then IccRgb, IccCmyk, IccGray and IccOutput should also be set to "standard" or paths to color profiles. All color spaces are assumed to be device independent color spaces.

If this property is set to "device" then IccRgb, IccCmyk, IccGray and IccOutput should also be set to "device". All color spaces are all assumed to be device color spaces.

If this property is set to a file name with no path information, then the folder "<windows>\system32\spool\drivers\color" will be searched to locate the file.

This parameter defaults to "standard".

[VBScript]
mycanvas.DrawFile Server.MapPath("zoo.pdf"), "IccRgb=myprofile.icm"

 

   
17
 
IccGray    
     

A path to the default Grayscale ICC color profile.

This parameter is used only by the Advanced PostScript module when rendering EPS or PDF files. It is used to specify the profile that will be used to convert any device Grayscale specified in the PDF file to the device independent working color space.

This is used when the output ColorSpace is Lab or another device independent color space such as sRGB. If the IccOutput indicates that a color profile should be used the output is always device independent. If the IccOutput indicates that no color profile should be used then the output is always device dependent.

This property can take a path to an icm file. However there are also two special values you can use. If the property takes the value "device" then the device color space will be used. If the property takes the value "standard" then a built in default color profile will be used.

If this property is set to "standard" or a path to a color profile then IccRgb, IccCmyk, IccGray and IccOutput should also be set to "standard" or paths to color profiles. All color spaces are assumed to be device independent color spaces.

If this property is set to "device" then IccRgb, IccCmyk, IccGray and IccOutput should also be set to "device". All color spaces are all assumed to be device color spaces.

If this property is set to a file name with no path information, then the folder "<windows>\system32\spool\drivers\color" will be searched to locate the file.

This parameter defaults to "standard".

[VBScript]
mycanvas.DrawFile Server.MapPath("zoo.pdf"), "IccGray=myprofile.icm"