Class NeuQuant

A NeuQuant instance.

Constructors

  • Create a new NeuQuant instance.

    Parameters

    • sampleFactor: number
    • maxColors: number
    • pixels: Uint8Array

    Returns NeuQuant

Methods

  • Returns the RGB color map calculated from the sample.

    Returns Uint8Array

  • Returns the RGBA color map calculated from the sample.

    Returns Uint8Array

  • Finds the best-matching index in the color map. pixel is assumed to be in RGBA format.

    Parameters

    • pixel: Uint8Array

    Returns number

  • Lookup pixel values for color at idx in the colormap.

    Parameters

    • idx: number

    Returns null | Uint8Array<ArrayBufferLike>

  • Maps the rgba-pixel in-place to the best-matching color in the color map.

    Parameters

    • pixel: Uint8Array

    Returns void