Crates.io | kitty_image |
lib.rs | kitty_image |
version | 0.1.0 |
source | src |
created_at | 2023-12-17 16:40:01.71695 |
updated_at | 2023-12-17 16:40:01.71695 |
description | Display images using the kitty image protocol |
homepage | |
repository | https://gitlab.com/john_t/kitty-images |
max_upload_size | |
id | 1072611 |
size | 483,191 |
A simple rust crate to allow you to display images using the Kitty Image Protocol, most likely for the Kitty Terminal emulator.
Observe the ease in which you can display an image located on the file system:
// Create an action
let action = Action::TransmitAndDisplay(
ActionTransmission {
format: Format::Png,
medium: Medium::File,
width: 367,
height: 480,
..Default::default()
},
kitty_image::ActionPut::default(),
);
// Add the payload to the command
let command = Command::with_payload_from_path(action, "examples/the_scream.png".as_ref());
// Wrap the command in escape codes
let command = WrappedCommand::new(command);
// Print it
println!("{command}");
Check out the examples