UXP Toolkit
    Preparing search index...

    Interface IndexedConversionOptions

    Options for converting an RGB image to an indexed color model using Document.changeMode

    const doc = app.activeDocument;
    await doc.changeMode(constants.ChangeMode.INDEXEDCOLOR, {
    palette: constants.Palette.LOCALPERCEPTUAL,
    colors: 256,
    dither: constants.Dither.DIFFUSION,
    transparency: true
    });
    // Convert with web palette
    await doc.changeMode(constants.ChangeMode.INDEXEDCOLOR, {
    palette: constants.Palette.WEBPALETTE,
    colors: 216,
    preserveExactColors: true
    });

    objects/conversionoptions

    23.0

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

    Properties

    colors?: number

    The number of palette colors.

    Valid only with palette types: LOCALADAPTIVE, LOCALPERCEPTUAL, LOCALSELECTIVE, MACOSPALETTE, UNIFORM, WEBPALETTE, or WINDOWSPALETTE.

    23.0

    dither?: Dither

    The type of dithering to be done.

    23.0

    ditherAmount?: number

    The amount of dithering to be done.

    Valid only when dither typ is DIFFUSION.

    23.0

    forced?: ForcedColors

    The set of colors to force into the color palette.

    23.0

    matte?: MatteColor

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

    When transparency is false, the matte color is applied to transparent areas.

    WHITE
    

    23.0

    palette?: Palette

    The palette type.

    23.0

    preserveExactColors?: boolean

    When true, the image colors matching entries in the color table will not be dithered.

    23.0

    transparency?: boolean

    When true, transparent areas of the image are preserved during conversion to GIF format.

    23.0