Skip to content

rs_rich.art.image_art

Generated from the type stubs by scripts/gen_python_api.py; do not edit.

rich_art::image_art: ImageArt, the picker across every backend.

ArtImage

width property

width: int

height property

height: int

size property

size: Tuple[int, int]

mode property

mode: str

open staticmethod

open(path: Any) -> ArtImage

from_bytes staticmethod

from_bytes(data: Union[bytes, bytearray, memoryview]) -> ArtImage

from_pil staticmethod

from_pil(image: Any) -> ArtImage

frombytes staticmethod

frombytes(mode: Literal['RGBA', 'RGB', 'LA', 'L'], size: Tuple[int, int], data: Union[bytes, bytearray, memoryview]) -> ArtImage

tobytes

tobytes() -> bytes

to_rgba

to_rgba() -> bytes

to_png

to_png() -> bytes

save

save(path: Any) -> None

to_pil

to_pil() -> Any

ImageArt

image property

image: ArtImage

options property

options: ImageOptions

mode property

mode: str

width property

width: Optional[int]

height property

height: Optional[int]

color property

color: bool

fit property

fit: Optional[str]

anchor property

anchor: str

background property

background: Union[None, str, Tuple[int, int, int]]

color_mode property

color_mode: str

dither property

dither: Optional[str]

color_distance property

color_distance: str

rotate property

rotate: int

flip_horizontal property

flip_horizontal: bool

flip_vertical property

flip_vertical: bool

grayscale property

grayscale: bool

brightness property

brightness: float

contrast property

contrast: float

gamma property

gamma: float

max_width property

max_width: Optional[int]

max_height property

max_height: Optional[int]

resolve_mode

resolve_mode(capabilities: RenderCapabilities) -> str

native_grid

native_grid(mode: str, available: int) -> Tuple[int, int]

ImageArtError

Bases: ArtError

An image cannot be rendered as asked; kind says why.

kind instance-attribute

kind: str

ImageDecodeError

Bases: ArtError

Image bytes could not be decoded.

ImageOptions

mode property

mode: str

width property

width: Optional[int]

height property

height: Optional[int]

color property

color: bool

RenderCapabilities

color instance-attribute

color: bool

sixel_supported instance-attribute

sixel_supported: bool

from_console staticmethod

from_console(console: Console) -> RenderCapabilities