Pixel Data JS - v0.28.0
    Preparing search index...

    Function indexedImageToAverageColor

    • Calculates the area-weighted average color of an IndexedImage. This accounts for how often each palette index appears in the pixel data.

      Parameters

      • indexedImage: IndexedImage

        The IndexedImage containing pixel indices and the palette.

      • includeTransparent: boolean = false

        Whether to include the transparent pixels in the average.

      Returns Color32

      The average RGBA color of the image.