3 releases

0.2.2 Jul 24, 2022
0.2.1 Jul 3, 2022
0.2.0 May 10, 2021

#670 in Command-line interface

Download history 131/week @ 2024-03-12 90/week @ 2024-03-19 103/week @ 2024-03-26 193/week @ 2024-04-02 96/week @ 2024-04-09 112/week @ 2024-04-16 105/week @ 2024-04-23 109/week @ 2024-04-30 113/week @ 2024-05-07 104/week @ 2024-05-14 179/week @ 2024-05-21 152/week @ 2024-05-28 91/week @ 2024-06-04 99/week @ 2024-06-11 117/week @ 2024-06-18 74/week @ 2024-06-25

399 downloads per month
Used in 2 crates

MIT license

12KB
193 lines

An image display widget for tui-rs

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:

  • Luma: Single color display using block intensity
  • RGB: Relies on a RGB compatible terminal to show filled blocks with full RGB color.

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.

Options

  • block: Use this block instead of filling the container
  • color_mode: ColorMode::Luma or ColorMode::Rgb
  • alignment: The horizontal alignment of the image within the container
  • style: The Style used to composite the image against the background

Repography logo / Recent activity Time period

Pull request status graph Top contributors

Dependencies

~15–24MB
~163K SLoC