meo-skia-canvas
    Preparing search index...

    Function loadImageData

    • Reads raw pixels into an ImageData, from the same sources loadImage takes.

      The bytes are treated as pixels rather than as an encoded image, so the dimensions cannot be inferred from them and width is required. height is derived from the buffer's length when it is left out.

      Parameters

      • src: string | URL | Buffer<ArrayBufferLike>
      • width: number
      • Optionalheight: number

      Returns Promise<ImageData>

    • As above, naming the layout the bytes are in.

      settings carries the colorType and colorSpace the pixels should be read as, alongside the fetch request options used when src is a remote URL. Both default to the putImageData wire format: "rgba" in "srgb", unpremultiplied.

      Parameters

      • src: string | URL | Buffer<ArrayBufferLike>
      • width: number
      • height: number
      • Optionalsettings: ImageDataSettings & RequestInit

      Returns Promise<ImageData>

    • Takes the raw pixels of a Sharp image.

      No dimensions are asked for: Sharp reports its own, and they are used in preference to anything passed. The image gains an alpha channel if it has none.

      Parameters

      • src: Sharp

      Returns Promise<ImageData>