ExportOptionsPNG8
ExportOptionsPNG8
Section titled “ExportOptionsPNG8”exportOptionsPNG8
Description
Section titled “Description”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.
Properties
Section titled “Properties”ExportOptionsPNG8.antiAliasing
Section titled “ExportOptionsPNG8.antiAliasing”exportOptionsPNG8.antiAliasing
Description
Section titled “Description”If true
, the exported image should be anti-aliased.
Default: true
.
Boolean.
ExportOptionsPNG8.artBoardClipping
Section titled “ExportOptionsPNG8.artBoardClipping”exportOptionsPNG8.artBoardClipping
Description
Section titled “Description”If true
, the exported image should be clipped to the art board.
Default: false
.
Boolean.
ExportOptionsPNG8.colorCount
Section titled “ExportOptionsPNG8.colorCount”exportOptionsPNG8.colorCount
Description
Section titled “Description”The number of colors in the exported image’s color table.
Range: 2 to 256.
Default: 128.
Number (long).
ExportOptionsPNG8.colorDither
Section titled “ExportOptionsPNG8.colorDither”exportOptionsPNG8.colorDither
Description
Section titled “Description”The method used to dither colors in the exported image.
Default: ColorDitherMethod.Diffusion
.
ExportOptionsPNG8.colorReduction
Section titled “ExportOptionsPNG8.colorReduction”exportOptionsPNG8.colorReduction
Description
Section titled “Description”The method used to reduce the number of colors in the exported image.
Default: ColorReductionMethod.SELECTIVE
.
ExportOptionsPNG8.ditherPercent
Section titled “ExportOptionsPNG8.ditherPercent”exportOptionsPNG8.ditherPercent
Description
Section titled “Description”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
Section titled “ExportOptionsPNG8.horizontalScale”exportOptionsPNG8.horizontalScale
Description
Section titled “Description”The horizontal scaling factor to apply to the exported image, where 100.0 is 100%.
Default: 100.0.
Number (double).
ExportOptionsPNG8.interlaced
Section titled “ExportOptionsPNG8.interlaced”exportOptionsPNG8.interlaced
Description
Section titled “Description”If true
, the exported image should be interlaced.
Default: false
.
Boolean.
ExportOptionsPNG8.matte
Section titled “ExportOptionsPNG8.matte”exportOptionsPNG8.matte
Description
Section titled “Description”If true
, the art board should be matted with a color.
Default: true
.
Boolean.
ExportOptionsPNG8.matteColor
Section titled “ExportOptionsPNG8.matteColor”exportOptionsPNG8.matteColor
Description
Section titled “Description”The color to use when matting the art board.
Default: white
.
ExportOptionsPNG8.saveAsHTML
Section titled “ExportOptionsPNG8.saveAsHTML”exportOptionsPNG8.saveAsHTML
Description
Section titled “Description”If true
, the exported image be saved with an accompanying HTML file.
Default: false
.
Boolean.
ExportOptionsPNG8.transparency
Section titled “ExportOptionsPNG8.transparency”exportOptionsPNG8.transparency
Description
Section titled “Description”If true
, the exported image use transparency.
Default: true
.
Boolean.
ExportOptionsPNG8.typename
Section titled “ExportOptionsPNG8.typename”exportOptionsPNG8.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
ExportOptionsPNG8.verticalScale
Section titled “ExportOptionsPNG8.verticalScale”exportOptionsPNG8.verticalScale
Description
Section titled “Description”The vertical scaling factor to apply to the exported image, where 100.0 is 100.
Default: 100.0.
Number (double).
ExportOptionsPNG8.webSnap
Section titled “ExportOptionsPNG8.webSnap”exportOptionsPNG8.webSnap
Description
Section titled “Description”Specifies how much the color table should be changed to match the web palette, where 100 is maximum.
Default: 0.
Number (long).
Example
Section titled “Example”Exporting to PNG8 format
Section titled “Exporting to PNG8 format”// 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); }}