Companion

external object Companion(source)

Functions

Link copied to clipboard
external fun fromBytes(bytes: ArrayBuffer): Promise<Image>
external fun fromBytes(bytes: Uint8Array<*>): Promise<Image>
external fun fromBytes(bytes: ReadonlyArray<Double>): Promise<Image>

Creates a new image using the provided bytes by inferring the file format. If the format is known, prefer @link Image.fromPngBytes or @link Image.fromIcoBytes.

Link copied to clipboard
external fun fromPath(path: String): Promise<Image>

Creates a new image using the provided path.

Link copied to clipboard
external fun new(rgba: ArrayBuffer, width: Double, height: Double): Promise<Image>
external fun new(rgba: Uint8Array<*>, width: Double, height: Double): Promise<Image>
external fun new(rgba: ReadonlyArray<Double>, width: Double, height: Double): Promise<Image>

Creates a new Image using RGBA data, in row-major order from top to bottom, and with specified width and height.