Skip to content

ExportOptionsPNG8

exportOptionsPNG8

Options for exporting a document as an 8-bit PNG 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.


exportOptionsPNG8.antiAliasing

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

Default: true.

Boolean.


exportOptionsPNG8.artBoardClipping

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

Default: false.

Boolean.


exportOptionsPNG8.colorCount

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

Range: 2 to 256.

Default: 128.

Number (long).


exportOptionsPNG8.colorDither

The method used to dither colors in the exported image.

Default: ColorDitherMethod.Diffusion.

ColorDitherMethod


exportOptionsPNG8.colorReduction

The method used to reduce the number of colors in the exported image.

Default: ColorReductionMethod.SELECTIVE.

ColorReductionMethod


exportOptionsPNG8.ditherPercent

The amount (as a percentage) that the colors of the exported image are dithered, where 100.0 is 100%.

Range: 0 to 100.

Default: 88.

Number (long).


exportOptionsPNG8.horizontalScale

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

Default: 100.0.

Number (double).


exportOptionsPNG8.interlaced

If true, the exported image should be interlaced.

Default: false.

Boolean.


exportOptionsPNG8.matte

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

Default: true.

Boolean.


exportOptionsPNG8.matteColor

The color to use when matting the art board.

Default: white.

RGBColor


exportOptionsPNG8.saveAsHTML

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

Default: false.

Boolean.


exportOptionsPNG8.transparency

If true, the exported image use transparency.

Default: true.

Boolean.


exportOptionsPNG8.typename

The class name of the referenced object.

String; read-only.


exportOptionsPNG8.verticalScale

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

Default: 100.0.

Number (double).


exportOptionsPNG8.webSnap

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

Default: 0.

Number (long).


// Exports current document to dest as a PNG8 file with specified options,
// dest contains the full path including the file name
function exportFileToPNG8(dest) {
if (app.documents.length > 0) {
var exportOptions = new ExportOptionsPNG8();
exportOptions.colorCount = 8;
exportOptions.transparency = false;
var type = ExportType.PNG8;
var fileSpec = new File(dest);
app.activeDocument.exportFile(fileSpec, type, exportOptions);
}
}