pytauri.image
¶
Classes:
| Name | Description |
|---|---|
Image |
Image
¶
Bases: Image
Methods:
| Name | Description |
|---|---|
from_pil |
Creates a new image using the provided |
from_bytes |
Create an image from bytes. |
from_path |
Create an image from a file path. |
__new__ |
|
Attributes:
| Name | Type | Description |
|---|---|---|
rgba |
bytes
|
|
width |
int
|
|
height |
int
|
|
from_pil
classmethod
¶
Creates a new image using the provided PIL image.
The original tauri::image::Image::from_bytes only supports .ico and .png formats.
But this method supports all formats supported by PIL.
Note
Tauri requires images to be in RGBA mode.
If the provided image is not in RGBA mode, it will be converted to RGBA mode as a copy.
Source code in python/pytauri/src/pytauri/image.py
from_bytes
classmethod
¶
from_bytes(bytes_: Union[bytes, bytearray, memoryview]) -> Self
Create an image from bytes.
This method calls pytauri.image.Image.from_pil internally.
Source code in python/pytauri/src/pytauri/image.py
from_path
classmethod
¶
Create an image from a file path.
This method calls pytauri.image.Image.from_pil internally.