Skip to content

image

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/image.ts#L26

An RGBA Image in row-major order from top to bottom.

get rid(): number;

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L363

number

Resource.rid

asyncDispose: Promise<void>;

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L381

Promise<void>

Resource.[asyncDispose]

close(): Promise<void>;

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L375

Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.

Promise<void>

Resource.close

rgba(): Promise<Uint8Array<ArrayBuffer>>;

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/image.ts#L89

Returns the RGBA data for this image, in row-major order from top to bottom.

Promise<Uint8Array<ArrayBuffer>>

size(): Promise<ImageSize>;

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/image.ts#L96

Returns the size of this image.

Promise<ImageSize>

static fromBytes(bytes): Promise<Image>;

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/image.ts#L62

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].

Only ico and png are supported (based on activated feature flag).

Note that you need the image-ico or image-png Cargo features to use this API. To enable it, change your Cargo.toml file:

[dependencies]
tauri = { version = "...", features = ["...", "image-png"] }
Parameter Type
bytes | ArrayBuffer | Uint8Array<ArrayBufferLike> | number[]

Promise<Image>

static fromPath(path): Promise<Image>;

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/image.ts#L82

Creates a new image using the provided path.

Only ico and png are supported (based on activated feature flag).

Note that you need the image-ico or image-png Cargo features to use this API. To enable it, change your Cargo.toml file:

[dependencies]
tauri = { version = "...", features = ["...", "image-png"] }
Parameter Type
path string

Promise<Image>

static new(
rgba,
width,
height
): Promise<Image>;

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/image.ts#L37

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

Parameter Type
rgba | ArrayBuffer | Uint8Array<ArrayBufferLike> | number[]
width number
height number

Promise<Image>

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/image.ts#L9

Property Type Defined in
height number Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/image.ts#L13
width number Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/image.ts#L11

type MenuIcon =
| NativeIcon
| string
| Image
| Uint8Array
| ArrayBuffer
| number[];

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/image.ts#L17

A type that represents an icon that can be used in menu items.

function transformImage<T>(image): T;

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/image.ts#L107

Transforms image from various types into a type acceptable by Rust.

See tauri::image::JsImage for more information. Note the API signature is not stable and might change.

Type Parameter
T
Parameter Type
image | string | Image | ArrayBuffer | Uint8Array<ArrayBufferLike> | number[] | null

T


© 2026 Tauri Contributors. CC-BY / MIT