ImageScript v4.0.0
    Preparing search index...

    Type AliasQuantizeOptions

    QuantizeOptions: DitherOptions & (
        | { colors?: number; palette?: never }
        | { colors?: never; palette: Color[] }
    )

    Options of Image.quantize: either colors or palette (TypeScript reports a call with both), and the dithering

    Type Declaration

    • { colors?: number; palette?: never }
      • Optionalcolors?: number

        The maximum number of colors to keep (2-256). Images with fewer distinct colors keep them exactly; otherwise ImageScript chooses a smaller set of representative colors. Give palette instead to choose exact colors.

        256

      • Optionalpalette?: never

        Not with colors: give one of them

    • { colors?: never; palette: Color[] }
      • Optionalcolors?: never

        Not with palette: give one of them

      • palette: Color[]

        A fixed palette (1-256 colors, e.g. a Game Boy's four greens). Every pixel is changed to the nearest palette color by its red, green and blue values; transparency in palette colors is ignored