Skip to content

ExportOptionsGIF

exportOptionsGIF

Options for exporting a document as a GIF file, used with the Document.exportFile() method. All properties are optional.

When you export a document, the appropriate file extension is appended automatically. You should not include any file extension in the file specification.


exportOptionsGIF.antiAliasing

If true, the exported image should be anti-aliased.

Default: true.

Boolean.


exportOptionsGIF.artBoardClipping

If true, the exported image should be clipped to the art board.

Default: false.

Boolean.


exportOptionsGIF.colorCount

The number of colors in the exported image’s color table.

Range: 2 to 256.

Default: 128.

Number (long).


exportOptionsGIF.colorDither

The method used to dither colors in the exported image.

Default: ColorDitherMethod.DIFFUSION.

ColorDitherMethod


exportOptionsGIF.colorReduction

The method used to reduce the number of colors in the exported image. Default: ColorReductionMethod.SELECTIVE.

ColorReductionMethod


exportOptionsGIF.ditherPercent

How much should the colors of the exported image be dithered, where 100.0 is 100%.

Number (long).


exportOptionsGIF.horizontalScale

The horizontal scaling factor to apply to the exported image, where 100.0 is 100%.

Default: 100.0.

Number (double).


exportOptionsGIF.infoLossPercent

The level of information loss allowed during compression, where 100.0 is 100%.

Number (long).


exportOptionsGIF.interlaced

If true, the exported image should be interlaced.

Default: false.

Boolean.


exportOptionsGIF.matte

If true, the art board should be matted with a color.

Default: true.

Boolean.


exportOptionsGIF.matteColor

The color to use when matting the art board.

Default: WHITE.

RGBColor


exportOptionsGIF.saveAsHTML

If true, the exported image should be saved with an accompanying HTML file.

Default: false.

Boolean.


exportOptionsGIF.transparency

If true, the exported image should use transparency.

Default: true.

Boolean.


exportOptionsGIF.typename

The class name of the referenced object.

String; read-only.


exportOptionsGIF.verticalScale

The vertical scaling factor to apply to the exported image, where 100.0 is 100%.

Default: 100.0.

Number (double).


exportOptionsGIF.webSnap

How much should the color table be changed to match the web palette, where 100 is maximum.

Default: 0.

Number (long).


// Exports current document to dest as a GIF file with specified options,
// dest contains the full path including the file name
function exportToGIFFile(dest) {
if (app.documents.length > 0) {
var exportOptions = new ExportOptionsGIF();
exportOptions.antiAliasing = false;
exportOptions.colorCount = 64;
exportOptions.colorDither = ColorDitherMethod.DIFFUSION;
var type = ExportType.GIF;
var fileSpec = new File(dest);
app.activeDocument.exportFile(fileSpec, type, exportOptions);
}
}