CNSImage_Convert
- Description
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 Type
- Container
- Format
- CNSImage_Convert ( Image ; Type ; Resolution ; Depth ; Quality )
- Required Parameters
- Image
A Container field that contains an Image or a Path and File Name to an Image you want to Convert.
- Type
The Type of the new Image. (Specify "" to keep the current Image Type. Types include: "JPEG", "PNG", "BMP", "PICT", "TIFF", "PSD", "SGI", "TGA", and "PDF")
- Image
- Optional Parameters
- Resolution
The Resolution in pixels per inch of the new Image. (Specify "" to keep the current Resolution.)
- Depth
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.)
- Quality
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.)
- Resolution
- Related Items
- Reference: Image Types
- Examples
Example 1
Code:
CNSImage_Convert( MyImage ;"JPEG"; 72 ; 32 ; 100 )Result:
Returns a JPEG image with a resolution of 72, a depth of 32, and quality of 100.Example 2
Code:
CNSImage_Convert( MyImage ;"PNG"; 72 )Result:
Returns a PNG image with a resolution of 72.