rs_rich.art: the rich-art crate (no Rich counterpart).
Images in every mode (ASCII, half-blocks, Braille, quadrants, Sixel), fit,
anchor, background, colour mode, dither and adjustment; FIGlet banners;
animated GIFs; and perceptual image diffs. Everything renders in Rust.
Submodules mirror the crate's modules: image_art, ascii, block,
braille, quadrant, sixel, figlet, gif, stage and
imagediff.
DEFAULT_RAMP
module-attribute
SIXEL_DEFAULT_CELL_PX
module-attribute
SIXEL_DEFAULT_CELL_PX: Tuple[int, int]
SIXEL_MAX_PIXELS
module-attribute
STANDARD_FONT
module-attribute
AnimatedArt
MAX_DECODED_BYTES
instance-attribute
repeat
property
repeat: Union[int, Literal['forever']]
frame_delay
frame_delay(index: int) -> Optional[float]
frame
frame(index: int) -> Optional[AsciiArt]
render_frame
render_frame(index: int) -> Optional[GifFrame]
frames
frames() -> List[Tuple[GifFrame, float]]
play
play(console: Optional[Console] = None) -> None
ArtError
Bases: Exception
The base of the art errors.
ArtImage
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
AsciiArt
columns
columns(available: int) -> int
to_text
to_text(width: int) -> str
BrailleArt
to_text
to_text(width: int) -> str
DiffRegion
height
instance-attribute
area_px
instance-attribute
share_of_change
instance-attribute
mean_delta_e
instance-attribute
DiffReport
changed_fraction
property
naive_changed_fraction
property
naive_changed_fraction: float
regions
property
regions: List[DiffRegion]
highlight
highlight(after: Any) -> ArtImage
DiffSettings
threshold
instance-attribute
open_kernel
instance-attribute
min_region
instance-attribute
Figlet
to_text
to_text(width: Optional[int] = None) -> str
FigletFont
parse
staticmethod
parse(source: str) -> FigletFont
from_path
staticmethod
from_path(path: Any) -> FigletFont
FigletFontError
Bases: ArtError
A FIGfont could not be parsed.
ImageArt
background
property
background: Union[None, str, Tuple[int, int, 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.
ImageDecodeError
Bases: ArtError
Image bytes could not be decoded.
ImageDiffError
Bases: ArtError
Two images cannot be compared; kind says why.
RenderCapabilities
sixel_supported
instance-attribute
from_console
staticmethod
from_console(console: Console) -> RenderCapabilities
SixelArt
encode
encode(available: int) -> Optional[str]
Stage
add
add(art: AnimatedArt) -> Stage
play
play(console: Optional[Console] = None) -> None
figlet_render
figlet_render(text: str, font: Optional[FigletFont] = None, width: int = 80, justify: Literal['left', 'center', 'right'] = 'left') -> str
image_diff
image_diff(before: Any, after: Any, settings: Optional[DiffSettings] = None, *, blur: Optional[float] = None, threshold: Optional[float] = None, open_kernel: Optional[int] = None, min_region: Optional[int] = None, top: Optional[int] = None) -> DiffReport
show_cursor_sequence
show_cursor_sequence() -> str
sixel_is_probably_supported
sixel_is_probably_supported() -> bool