| Crates.io | viuer |
| lib.rs | viuer |
| version | 0.9.2 |
| created_at | 2020-09-27 19:49:14.669661+00 |
| updated_at | 2025-06-22 13:41:52.10538+00 |
| description | Display images in the terminal |
| homepage | |
| repository | https://github.com/atanunq/viuer |
| max_upload_size | |
| id | 293506 |
| size | 95,123 |
viuerDisplay images in the terminal with ease.
viuer is a Rust library that makes it easy to show images in the terminal.
It has a straightforward interface and is configured through a single struct.
The default printing method is through lower half blocks (▄ or \u2585).
However some custom graphics protocols are supported. They result in full
resolution images being displayed in specific environments:
For a demo of the library's usage and example screenshots, see
viu.
With the default features, only image::DynamicImage can be printed:
use viuer::{print, Config};
let conf = Config {
// Start from row 4 and column 20.
x: 20,
y: 4,
..Default::default()
};
let img = image::DynamicImage::ImageRgba8(image::RgbaImage::new(20, 10));
print(&img, &conf).expect("Image printing failed.");
And with the print-file feature, viuer can work with files, too:
use viuer::{print_from_file, Config};
let conf = Config {
// Set dimensions.
width: Some(80),
height: Some(25),
..Default::default()
};
// Display `img.jpg` with dimensions 80×25 in terminal cells.
// The image resolution will be 80×50 because each cell contains two pixels.
print_from_file("img.jpg", &conf).expect("Image printing failed.");
Find all the configuration options in the full documentation.