From d93e147914507f2b1be407a6d4c99944ab2e1376 Mon Sep 17 00:00:00 2001 From: djairoh Date: Wed, 8 Feb 2023 23:34:24 +0100 Subject: [PATCH] README updated --- README.md | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++--- src/main.rs | 5 ----- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index daa1849..b72ee82 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,63 @@ # img2ascii -CLI that converts images into ascii art and prints them to the console +This Command-Line tool converts input images into ASCII art. + +It can be configured using flags on the command line, a few options of which are: + * Simple ASCII (using the map ` .:-=+*#%@"`) + * Complex ASCII (using the map ``` .'`^",:;Il!i><~+_-?][}{1)(|\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$```) + * [Braille symbols](https://en.wikipedia.org/wiki/Braille_Patterns) + * Custom character maps (through the `--map` flag) + +# Prerequisites +* [Rust](https://www.rust-lang.org/) (building from source only) + +# Installation +Installing is pretty easy, +just grab the appropriate executable from the releases tab, +and you're good to go! + +## Building from source +```shell +git clone https://github.com/djairoh/img2ascii +cd ./img-search +cargo build --release +mv ./target/release/ +./img2ascii [FLAGS] +``` + +# Running +Running the program is very simple. +Simply execute `./img2ascii ` and it will convert to ASCII and print to stdout. + +Of course the output can be customized, by using one (or more) flags. +## options + * -c, --complex: uses the extended character map + * -C, --colour: Display ASCII art in full 24-bit colour + * -b, --braille: Use braille characters instead of a character map + * -d, --debug: Print debugging information + * -f, --full: use the full width of the terminal, instead of fitting the image to the terminal dimensions + * --threshold: use a custom threshold when converting to braille (range 0-255, default: 128) + * -M, --map: use a custom character map + * -w, --width: force a specific width of the output + * -o, --output: Save the output to a text file, instead of printing to terminal + * -h, --help: Print help information (extended info with '--help') + +## conflicting flags +The flags `--complex`, `--braille`, `--map` conflict. +When two or more of these are entered in the same command, +the program uses the one with the highest precedence, in the order +`braille > complex > map`. + +The flags `--output` and `--colour` also conflict. +When both are entered, the flag `--output` takes precedence +(leading to a simple txt file). + +Lastly, the flags `--full` and `--width` are mutually exclusive. +When both are entered, the flag `-full` will be applied +(`full > width`). + +# Documentation +The program has been documented with RustDoc, +which can be compiled and viewed with +`cargo doc --open`. - -//todo: Update this \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 7f6edc0..2117d0a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,11 +14,6 @@ mod ascii_manipulation; mod output; mod model_rgb_ascii; -//todo: general -/* Readme - */ - - /// This is the main function. /// /// It drives the CLI module, calls the appropriate convert functions and directs output.