png-compressor
    Preparing search index...

    Interface IPngMetadataBackgroundColor

    A metadata entry that defines an image's preferred default background color to present it against. This is typically used in image viewers but not in web browsers (where an existing background color exists) or image editors (where retaining transparency is important).

    An example of where this might be useful is a diagram with text all in black where everything else is transparent, opening this in an image viewer with a dark background would make this unreadable but not if the image viewer respected a white bKGD entry.

    interface IPngMetadataBackgroundColor {
        color: number | [number, number, number];
        type: "bKGD";
    }
    Index

    Properties

    Properties

    color: number | [number, number, number]

    The preferred background color. The format of this property depends on the IPngDetails.colorType of the image:

    • 0 (Greyscale): The lightness of the color (0-255).
    • 2 (Truecolor): A number array made up of each color channel (each 0-255).
    • 3 (Indexed): The palette color index (0-255).
    • 4 (Greyscale and alpha): The lightness of the color (0-255).
    • 6 (Truecolor and alpha): A number array made up of each color channel (each 0-255).
    type: "bKGD"

    The type of metadata, this is typically the name of the chunk from which is originates.