Crate tapciify

source ·
Expand description

Tool to convert your images into ASCII art

Useful functions, when using as lib

§Installation

cargo install tapciify

§Converting image

  1. Run: tapciify -i imagePath -w imageWidth for image.

  2. Run: tapciify -i imagePath -w imageWidth -r for reversed colors.

§Converting video

In this example I set framerate to 24 (but you can use any another)

Requires ffmpeg

  1. Make frames from video into dir:

    mkdir frames; ffmpeg -i bad_apple.mkv frames/%08d.jpeg
    
  2. Run:

    tapciify -i frames/* -w videoWidth -f 24
    

§Examples

Demo:

use image::imageops::FilterType;


use tapciify::{
    AsciiArtConverter, AsciiArtConverterOptions, CustomRatioResize, DEFAULT_FONT_RATIO,
};

let img = image::open("./assets/examples/ferris.webp")?;

let result = img
    .resize_custom_ratio(Some(64), None, DEFAULT_FONT_RATIO, FilterType::Triangle)
    .ascii_art(&AsciiArtConverterOptions {
        // Put your other options here
        ..Default::default()
})?;

println!("{}", result);

Colored:

use std::error::Error;


use tapciify::{
    AsciiArtConverter, AsciiArtConverterOptions, CustomRatioResize, DEFAULT_FONT_RATIO,
};

let img = image::open("./assets/examples/ferris.webp")?;

let result = img
    .resize_custom_ratio(Some(64), None, DEFAULT_FONT_RATIO, FilterType::Triangle)
    .ascii_art(&AsciiArtConverterOptions {
        // Put your other options here
        colored: true,
        ..Default::default()
    })?;

println!("{}", result);

Modules§

Macros§

  • Macro for joining multiple iterators

Structs§

Enums§

Constants§

Traits§

Functions§