class documentation
Represents an image with RGB565 pixel data for MicroPython.
The raw pixel data is stored in self._raw and can be used by the Draw class.
| Method | __del__ |
Release the raw pixel data and size. |
| Method | __init__ |
Initialize an empty image with a zero size. |
| Method | from |
Create an image from a raw byte array. |
| Method | from |
Load a 16-bit BMP from disk into raw RGB565 data. |
| Method | from |
Create a tiny monochrome-style RGB565 image from ASCII art. |
| Method | get |
Get RGB565 pixel value at coordinates (x, y). |
| Instance Variable | is |
Undocumented |
| Instance Variable | size |
Undocumented |
| Method | _load |
Read BMP header and pixel data into self._raw as little-endian RGB565 bytes. |
| Instance Variable | _raw |
Undocumented |
Create an image from a raw byte array.
| Parameters | |
| data | Pixel data as bytes, bytearray, or memoryview. |
size:Vector | The image size (width, height). |
isbool | Whether the data is 8-bit. Defaults to True. |
| Returns | |
bool | True on success. |
| Raises | |
ValueError | If the data length does not match the expected size. |
Load a 16-bit BMP from disk into raw RGB565 data.
| Parameters | |
path:str | The path to the BMP file. |
| Returns | |
bool | True on success, False on failure. |
Create a tiny monochrome-style RGB565 image from ASCII art.
| Parameters | |
imagestr | The ASCII art string with one row per line. |
Get RGB565 pixel value at coordinates (x, y).
| Parameters | |
x:int | The X coordinate. |
y:int | The Y coordinate. |
| Returns | |
int | The RGB565 pixel value, or 0 if out of bounds. |