#convert-images #ascii #ascii-art #image #output #color #colored

bin+lib crascii

A Rust library for converting images to ASCII art

1 unstable release

new 0.0.1 Jan 26, 2025

#34 in #colored

Download history 84/week @ 2025-01-22

84 downloads per month

MIT license

3MB
496 lines

crascii

Overview

crascii is a Rust-based command-line tool that converts images into ASCII art. It allows for customization of the output dimensions, color, and character sets, and supports saving or printing the ASCII output directly to the console.

Features

  • Convert images to ASCII art.
  • Adjustable output dimensions (width and height).
  • Supports colored ASCII output.
  • Customizable character sets for ASCII conversion.
  • Save the output to a file or print it directly to the terminal.

Requirements

  • Rust (for building and running the tool).
  • An image processing library compatible with Rust (e.g., image).

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-folder>
    
  2. Build the project:

    cargo build --release
    
  3. Run the executable:

    ./target/release/crascii
    

Usage

Run the tool from the terminal with the following options:

crascii [OPTIONS] --image <IMAGE> --output-path <OUTPUT_PATH>

Options

  • -i, --image <IMAGE>: Path to the input image file to be converted.
  • -w, --columns <COLUMNS>: Number of columns (width) for the ASCII output (optional).
  • -H, --lines <LINES>: Number of lines (height) for the ASCII output (optional).
  • -C, --color: Enable colored ASCII output (optional).
  • -c, --charsets <CHARSETS>: Character set to use for ASCII conversion (default: "default").
  • -o, --output-path <OUTPUT_PATH>: Path to save the ASCII output file.
  • -p, --print: Print the ASCII art directly to the terminal (optional).
  • -h, --help: Show the help message.

Example Commands

  1. Convert an image to ASCII and save it:

    crascii -i my_image.png -o output.txt
    
  2. Specify custom dimensions for the output:

    crascii -i my_image.png -w 100 -H 50 -o output.txt
    

Development

  1. Install Rust: Rust installation guide.
  2. Install dependencies:
    cargo build
    
  3. Run the tool:
    cargo run -- [OPTIONS]
    

Contributing

Contributions are welcome! Feel free to submit issues or pull requests to enhance the tool.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

  • Rust community for support and documentation.

Dependencies

~10–17MB
~244K SLoC