Product Logo

CNS Image

Import, edit, and export Images in the FileMaker environment




The CNSImage_Convert function allows you to convert an image. You can change the type of the image as well as the resolution, and depth. If your target image type is JPEG or TIFF, you can set the Quality.

For a list of image types, see “Reference: Image Types”.

Return TypeContainer
FormatCNSImage_Convert ( Image ; Type ; Resolution ; Depth ; Quality )
Required Parameters

A Container field that contains an Image or a Path and File Name to an Image you want to Convert.


The Type of the new Image. (Specify “” to keep the current Image Type. Types include: “JPEG”, “PNG”, “BMP”, “PICT”, “TIFF”, “PSD”, “SGI”, and “TGA”)

Optional Parameters

The Resolution in pixels per inch of the new Image. (Specify “” to keep the current Resolution.) By default, specifying a new resolution will resample the image. If you do not want the image resampled, use an exclamation point after the resolution (e.g. “300!”).


The Bit-Depth of the new Image. (All settings may not work for all Image Types; Specify “” or 0 to keep the current Bit-Depth. Depths include: 1, 2, 4, 8, 16, 24, 32, 33, 34, 36, and 40.)


The Quality of the new Image. (Only available for JPEGs, and TIFFs; Specify “” or 0 to keep the current Quality. You can also specify a number or keyword: “Min”, “Low”, “Normal”, “High”, “Max”, “Lossless”, or a number between 1 and 100.)

Example 1

Returns a JPEG image with a resolution of 72, a depth of 32, and quality of 100.

CNSImage_Convert( MyImage ; "JPEG" ; 72 ; 32 ; 100 )
Example 2

Returns a PNG image with a resolution of 72.

CNSImage_Convert( MyImage ; "PNG" ; 72 )
Example 3

Returns a PNG image with a resolution of 300, but does not resample the image.

CNSImage_Convert( MyImage ; "PNG" ; "300!" )