UXP Toolkit
    Preparing search index...

    Options for saving a document in GIF format using the Document.saveAs method

    const doc = app.activeDocument;
    const saveFile = await require('uxp').storage.localFileSystem.getFileForSaving("image.gif");
    await doc.saveAs.gif(saveFile, {
    colors: 256,
    transparency: true,
    interlaced: false
    });

    objects/saveoptions

    22.5

    interface GIFSaveOptions {
        colors?: number;
        dither?: Dither;
        ditherAmount?: number;
        forced?: ForcedColors;
        interlaced?: boolean;
        matte?: MatteColor;
        palette?: Palette;
        preserveExactColors?: boolean;
        transparency?: boolean;
    }
    Index

    Properties

    colors?: number

    The number of palette colors. Valid only when palette is:

    Palette.LOCALADAPTIVE, LOCALPERCEPTUAL, LOCALSELECTIVE, MACOSPALETTE, UNIFORM, WEBPALETTE; or WINDOWSPALETTE

    22.5

    dither?: Dither

    The dither type.

    22.5

    ditherAmount?: number

    The amount of dither.

    Valid only when dither = Dither.DIFFUSION.

    22.5

    forced?: ForcedColors

    The type of colors to force into the color palette.

    22.5

    interlaced?: boolean

    True if rows should be interlaced.

    22.5

    matte?: MatteColor

    The color to use to fill anti-aliased edges adjacent to transparent areas of the image.

    When transparency is turned off for an image, the matte color is applied to transparent areas.

    22.5

    palette?: Palette

    The type of palette to use.

    22.5

    preserveExactColors?: boolean

    True to protect colors in the image that contain entries in the color table from being dithered.

    Valid only when dither = DITHER.DIFFUSION

    22.5

    transparency?: boolean

    True to preserve transparent areas of the image during conversion to GIF format.

    22.5