diff --git a/README.md b/README.md new file mode 100644 index 0000000..2bc5d07 --- /dev/null +++ b/README.md @@ -0,0 +1,193 @@ +# aarty: A simple CLI tool to convert the images to ASCII art with rust 🦀 + +![srceenshots/anime_2_colored_scale_4.gif](./srceenshots/anime_2_colored_scale_4.gif) +![money mouth face colored scale 2](./srceenshots/money_mouth_face_colored_scale_2.png) +![money mouth face normal scale 2](./srceenshots/money_mouth_face_normal_scale_2.png) + +
+More screenshots + +![crab colored scale 1](./srceenshots/crap_colored_scale_1.png) +[Original image](./images/crab.png) +![crap colored scale](./srceenshots/crap_colored_scale_2.png) +[Original image](./images/crab.png) +![nerd face colored scale](./srceenshots/nerd_face_colored_scale_2.png) +[Original image](./images/nerd_face.png) +![nerd face normal scale](./srceenshots/nerd_face_normal_scale_2.png) +[Original image](./images/nerd_face.png) +![srceenshots/anime_2_colored_scale_4.gif](./srceenshots/anime_2_colored_scale_4.gif) +[Original image](./images/anime_2.jpg) +![anime colored scale 3](./srceenshots/anime_colored_scale_3.gif) +[Original image](./images/anime.jpg) + +
+ +``` + ~~~~~~~!!!!~!!~ ~!!!!!!!!!~~~~~ + ~~~~!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!~~~~ + ~~~~~!!!!!!!!!!!!!!!!!!~ !!!!!!!!!!!!!!!!!!!!~~~~ + ~~~~~~!!!!!!!!!!!!!!!!!!!~ ~!!!!!!!!!!!!!!!!!!!!!!~~~~ + ~~~~~~~!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!~~~~~ + ~~~~~~~~!!!!!!!!!!!!!!!!!!!!!!~!!!!!!!!!!!!!!!!!!!!!!!!~~~~~ + ~~~~~~~~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!~~~~~ + ~~~~~~~~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!~~~~~ + ~~~~~~~~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!~~~~~~ + ~~~~~~~~~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!~~~~~~ + ~~~~~~~~~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!~~~~~~~ + ~~~~~~~~~~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!~~~~~~~ + ~~~~~~~~~~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!~~~~~~~ + ~~~~~~~~~~~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!~~~~~~~~ + ~~~~~~~~~~~~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!~~~~~~~~~ + ~~~~~~~~~~~~!!!!!!!!!!!!!!!!!!!!!!!!!!~~~~~~~~~~~ + ~~~~~~~~~~~~~~~!!!!!!!!!!!!!!!!!!!~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~!!!~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ + ~~~~~~~~~~ + ~~~~~ +``` + +## Install + +- from crates.io + ```bash + crago install aarty + ``` +- From aur: + ```shell + yay -S aarty + ``` + +## Options and arguments + + +```bash +aarty --help +``` +``` +A simple CLI tool to convert the images to ASCII art + +Usage: aarty [OPTIONS] + +Arguments: + + The image to convert to ASCII art + +Options: + -m, --mode + The art mode to use + + [default: normal-ascii] + + Possible values: + - normal-ascii: Normal ASCII art + - colored: Colored ASCII art, the colors are based on the terminal colors + + --output-method + [default: stdout] + + Possible values: + - file: Save the ascii art to a file + - stdout: Print the ascii art to the terminal + + -c, --characters + The character to use for drawing the image (lighter to darker) You can user one character if you uses the color mode + + [default: " .,-~!;:=*&%$@#"] + + -s, --scale + The output scale (1 is the original size) + + [default: 4] + + -b, --background + The background color to use + + -o, --output + The output file to write to (if output_method is file) + + [default: ascii_image.txt] + + -h, --help + Print help information (use `-h` for a summary) + + -V, --version + Print version information +``` + +## Examples + +```shell +aarty -m images/airplane.png +``` +``` + :=:** + =***:* + ~~!!!~~~~~~~ ~~~ =*****= + ~~~!!!!!!!!=*****= + ~:*****= + :===**:!~ + ;======~!!~~ + ;:===:: ~!~ + ;:;~::: ~!!~~ + ~~!!;~~:; !!~ + ~~!!~ ~!~ + ~!~ !~ + ~~ ~~ +``` + +```shell +aarty -m colored images/airplane.png +``` +![airplane colored scale 4](./srceenshots/airplane_colored_scale_4.png) + +```shell +aarty -m colored images/airplane.png -s 2 +``` +![airplane colored scale 2](./srceenshots/airplane_colored_scale_2.png) + +```shell +aarty -c " ~okOK#\$%" images/ok_hand.png +``` +``` + + $$$# + #$$$$# + K#KO#$$$$# + k###O#$$$$# + kK#OK$$$$#K + OKKO#$$$# + O#$$#O KKK$$$$# + K$$$$$$$$$$$$$#OOk#$$$#K + K$$$$$$$$$$$$$$$$##K#$$#K + #$K OO OK#$$$$$$$$$$### + #$$$$# OO##$$$$$$$$$# + O#$$$$# #$$$$$$$$$$KO + K#$$$$# K#$$$$$$$$$$KO + O#$$$$$$#KK####$$$$$$$$$##K + K#$$$$$$$$$$$$$$$$$$$$#KO + K##$$$$$$$$$$$$$$$$$##O + kK###$$$$$$$$$$$$###K + OK######$$######KO + OOKKKKKKKKOO +``` + +```shell +aarty -c " ~okOK#\$%" images/ok_hand.png -m colored +``` +![ok hand colored scale 4 custome chars](./srceenshots/ok_hand_colored_scale_4_custome_chars.png) + +```shell +aarty -c " ~okOK#\$%" images/ok_hand.png -m colored --output-method file -o ok_ascii.txt +``` +![ok hand colored scale 4 custome chars in file](./srceenshots/ok_hand_colored_scale_4_custome_chars_in_file.png) + +> If you get here, don't forget the star yooo ⭐ + + +[![License MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://spdx.org/licenses/MIT.html) diff --git a/images/blue_heart.png b/images/blue_heart.png new file mode 100644 index 0000000..fd683b7 Binary files /dev/null and b/images/blue_heart.png differ diff --git a/images/ok_hand.png b/images/ok_hand.png new file mode 100644 index 0000000..694ee3e Binary files /dev/null and b/images/ok_hand.png differ diff --git a/images/red_heart.png b/images/red_heart.png new file mode 100644 index 0000000..9043e06 Binary files /dev/null and b/images/red_heart.png differ diff --git a/ok_ascii.txt b/ok_ascii.txt new file mode 100644 index 0000000..e4f9a9e --- /dev/null +++ b/ok_ascii.txt @@ -0,0 +1,20 @@ +                                         +                     $$$#                +                     #$$$$#              +                  K#KO#$$$$#             +                  k###O#$$$$#            +                    kK#OK$$$$#K          +                      OKKO#$$$#          +              O#$$#O    KKK$$$$#         +         K$$$$$$$$$$$$$#OOk#$$$#K        +         K$$$$$$$$$$$$$$$$##K#$$#K       +       #$K OO     OK#$$$$$$$$$$###       +      #$$$$#         OO##$$$$$$$$$#      +      O#$$$$#          #$$$$$$$$$$KO     +       K#$$$$#       K#$$$$$$$$$$KO      +       O#$$$$$$#KK####$$$$$$$$$##K       +         K#$$$$$$$$$$$$$$$$$$$$#KO       +          K##$$$$$$$$$$$$$$$$$##O        +           kK###$$$$$$$$$$$$###K         +             OK######$$######KO          +                OOKKKKKKKKOO             diff --git a/srceenshots/airplane_colored_scale_2.png b/srceenshots/airplane_colored_scale_2.png new file mode 100644 index 0000000..678c9f4 Binary files /dev/null and b/srceenshots/airplane_colored_scale_2.png differ diff --git a/srceenshots/airplane_colored_scale_4.png b/srceenshots/airplane_colored_scale_4.png new file mode 100644 index 0000000..07d779e Binary files /dev/null and b/srceenshots/airplane_colored_scale_4.png differ diff --git a/srceenshots/airplane_normal_scale_2.png b/srceenshots/airplane_normal_scale_2.png new file mode 100644 index 0000000..51c369f Binary files /dev/null and b/srceenshots/airplane_normal_scale_2.png differ diff --git a/srceenshots/anime_2_colored_scale_4.gif b/srceenshots/anime_2_colored_scale_4.gif new file mode 100644 index 0000000..9f06338 Binary files /dev/null and b/srceenshots/anime_2_colored_scale_4.gif differ diff --git a/srceenshots/anime_colored_scale_3.gif b/srceenshots/anime_colored_scale_3.gif new file mode 100644 index 0000000..8dd8df2 Binary files /dev/null and b/srceenshots/anime_colored_scale_3.gif differ diff --git a/srceenshots/blue_heart_colored_scale_2.png b/srceenshots/blue_heart_colored_scale_2.png new file mode 100644 index 0000000..bb10877 Binary files /dev/null and b/srceenshots/blue_heart_colored_scale_2.png differ diff --git a/srceenshots/crap_colored_scale_1.png b/srceenshots/crap_colored_scale_1.png new file mode 100644 index 0000000..7f647d4 Binary files /dev/null and b/srceenshots/crap_colored_scale_1.png differ diff --git a/srceenshots/crap_colored_scale_2.png b/srceenshots/crap_colored_scale_2.png new file mode 100644 index 0000000..1ce96d8 Binary files /dev/null and b/srceenshots/crap_colored_scale_2.png differ diff --git a/srceenshots/crap_normal_scale_2.png b/srceenshots/crap_normal_scale_2.png new file mode 100644 index 0000000..d651314 Binary files /dev/null and b/srceenshots/crap_normal_scale_2.png differ diff --git a/srceenshots/heart_normal_scale_2.png b/srceenshots/heart_normal_scale_2.png new file mode 100644 index 0000000..75ae539 Binary files /dev/null and b/srceenshots/heart_normal_scale_2.png differ diff --git a/srceenshots/money_mouth_face_colored_scale_2.png b/srceenshots/money_mouth_face_colored_scale_2.png new file mode 100644 index 0000000..b9dcd2f Binary files /dev/null and b/srceenshots/money_mouth_face_colored_scale_2.png differ diff --git a/srceenshots/money_mouth_face_normal_scale_2.png b/srceenshots/money_mouth_face_normal_scale_2.png new file mode 100644 index 0000000..aa4cbb8 Binary files /dev/null and b/srceenshots/money_mouth_face_normal_scale_2.png differ diff --git a/srceenshots/nerd_face_colored_scale_2.png b/srceenshots/nerd_face_colored_scale_2.png new file mode 100644 index 0000000..7f68a0a Binary files /dev/null and b/srceenshots/nerd_face_colored_scale_2.png differ diff --git a/srceenshots/nerd_face_normal_scale_2.png b/srceenshots/nerd_face_normal_scale_2.png new file mode 100644 index 0000000..bbae406 Binary files /dev/null and b/srceenshots/nerd_face_normal_scale_2.png differ diff --git a/srceenshots/ok_hand_colored_scale_4_custome_chars.png b/srceenshots/ok_hand_colored_scale_4_custome_chars.png new file mode 100644 index 0000000..050f1d7 Binary files /dev/null and b/srceenshots/ok_hand_colored_scale_4_custome_chars.png differ diff --git a/srceenshots/ok_hand_colored_scale_4_custome_chars_in_file.png b/srceenshots/ok_hand_colored_scale_4_custome_chars_in_file.png new file mode 100644 index 0000000..9f16047 Binary files /dev/null and b/srceenshots/ok_hand_colored_scale_4_custome_chars_in_file.png differ diff --git a/srceenshots/penguin_colored_scale_2.png b/srceenshots/penguin_colored_scale_2.png new file mode 100644 index 0000000..f4ad677 Binary files /dev/null and b/srceenshots/penguin_colored_scale_2.png differ diff --git a/srceenshots/penguin_normal_scale_2.png b/srceenshots/penguin_normal_scale_2.png new file mode 100644 index 0000000..17653cf Binary files /dev/null and b/srceenshots/penguin_normal_scale_2.png differ diff --git a/srceenshots/red_heart_colored_scale_2.png b/srceenshots/red_heart_colored_scale_2.png new file mode 100644 index 0000000..e11f9f7 Binary files /dev/null and b/srceenshots/red_heart_colored_scale_2.png differ