Crates.io | tui-image-rgba-updated |
lib.rs | tui-image-rgba-updated |
version | 0.2.2 |
source | src |
created_at | 2021-05-10 00:34:58.721022 |
updated_at | 2022-07-24 02:59:55.650884 |
description | An image viewer widget for tui-rs |
homepage | https://github.com/arraypad/tui-image |
repository | https://github.com/arraypad/tui-image |
max_upload_size | |
id | 395387 |
size | 34,959 |
This widget displays an image using ASCII art.
Beware: This is work in progress and the API is very likely to change.
There are currently two modes:
You can either provide an image using Image::with_img
which will be resized to fit in the container, or you can provide a function with Image::with_img_fn
which receives the container size and returns an image of the correct dimensions.
At the moment it only accepts RGBA images and will halve the vertical resolution since terminal characters are roughly twice as high as wide.
block
: Use this block instead of filling the containercolor_mode
: ColorMode::Luma
or ColorMode::Rgb
alignment
: The horizontal alignment of the image within the containerstyle
: The Style used to composite the image against the background