Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter TenGraphic and Image Functions (continued)

10.2 Image Object Functions

10.2.1 Capabilities

Legato has a suite of functions that allow the manipulation of image data mostly for conversion and preparation for publishing. Images are also used in a number of other areas for presentation and use within menu functions, these are covered in other areas.

10.2.2 Image Objects

The Legato Image object is effectively a swath of bitmap memory loaded with an image from any number of formats. Once in memory, the object can be manipulated or written to another format.

When an image is loaded from a file, the file is only open during the load process. The Image object must be written to preserve any modifications.

10.2.3 Image Quality and Features

All images are converted to a 24-bit RGB format with an alpha channel (8-bits per channel). Therefore, certain information that could be part of the original image file is not and cannot be carried through to export. This is not normally an issue for typical charts and photographs.

However, there are certain features that are not supported and will be discarded. These include:

Animation — Animated GIFs and PNGs will have only the first frame loaded.

Alpha Blending — These include certain blended transparencies from PNG.

Original CMYK and Hue/Saturation Style Colors — Any color space other than RGB is converted to RGB.

Original Palette Information — Palettes from GIF and PNG are rendered to 24-bit color and discarded. This does not reduce the quality of the image but discards the original palette information. (Exporting to GIF will create a palette since that is the only manner in which GIF operates).

Colors Greater than 8-bits per Channel — These are down sampled (or truncated). The only formats that currently support greater than 24 are PNG and BMP

It is important to note that converting images will result in a loss of certain data no matter the platform. For example, GIF supports a maximum of 256 colors in the palette which means that moving from JPG to GIF could result in a loss of color information. This is not an issue unless the original data is required and that data is overwritten. For example, certain image editing applications (e.g., Adobe Photoshop®) can work with much higher channel resolution during editing to avoid certain undesired effects.

10.2.4 Functions

Object Loading and Creation:

ImageCreate — Creates an image of specified size (width and height) and background color.

ImageLoad — Opens a file and creates an Image Object.

Object Exporting:

ImageExport — Exports the image to the default format with the default options.

ImageExportBMP — Exports as a BMP file with specific options.

ImageExportGIF — Exports as a GIF File with specific options.

ImageExportJPEG — Exports as a JPEG with specific options.

ImageExportPNG — Exports as a PNG File with specific options.

Image Statistics:

ImageGetColors — Gets the current color depth of the loaded image. Internal images are always 32-bit.

ImageGetHeight — Gets the current height in pixels of the Image Object.

ImageGetWidth — Gets the current width in pixels of the Image Object.

Image Manipulation:

ImageResizePercent — Resizes Image Object by percentage.

ImageResizePixels — Resizes Image Object by fixed pixels.