Crate kitty_image

Source
Expand description

§Kitty Image

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

Structs§

ActionAnimationFrameComposition
ActionAnimationFrameControl
ActionAnimationFrameLoading
ActionDelete
ActionPut
ActionTransmission
Command
A command to the kitty graphics protocol.
Frame
A frame
ID
Placement
WrappedCommand
A command which prints the escape

Enums§

Action
AnimationMode
CompositionMode
DeleteTarget
Format
The format of the data
LoopMode
How to loop an animation
Medium
The medium to use
Quietness
The quiteness of the operation

Constants§

UNICODE_DIACRITICS
For unicode placeholders.