Skip to content

tsai8890/All2Dots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


All2Dots

Convert images to dot-based text.

About The ProjectGetting StartedPrerequisitesUsageRoadmapContributingContactAcknowledgments


About The Project

Key Features

  • Text to dots
    • Convert input text to vertically-aligned dot-based text.
  • Image to dots
    • Convert input image to dot-based text.

(back to top)

Getting Started

Prerequisites

  1. Clone the repo
    git clone https://github.com/tsai8890/All2Dots.git
  2. Install python packages
    cd All2Dots
    pip3 install -r requirements.txt

(back to top)

Usage

  1. Convert the specified image to dot-based text
    cd All2Dots
    python3 src/main.py <target> [options]
    
    # Ex: python3 src/main.py -t "早安"
    # Ex: python3 src/main.py -t "早安" -s line
    # Ex: python3 src/main.py -f ./images/shiba.jpg
    # Ex: python3 src/main.py -f ./images/shiba.jpg -w 100 -b light -t 110
    
    # Target:
    #    -f <filepath>       Convert any image to dot-based text
    #    -t <text>           Convert any text to vertically-aligned dot-based text
    #    
    # Options:
    #    -s <style>          Output style, other format-related params will be ignored if this option is specified. 
    #                        ['terminal', 'line']
    #                        
    #    -w <width>          Maximal width for each line
    #                        (default: 100)
    #
    #    -b <background>     Light or dark background mode
    #                        ['dark', 'light']
    #                        (default: 'dark')
    #    
    #    -T <threshold>      Threshold for converting grayscale image to binary image
    #                        (default: 132)

  1. The result will be directly shown on your terminal

    ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
    ⠀⠀⠀⢸⣟⠛⠛⠛⠛⠛⠛⠛⠛⢻⡇⠀⠀⠀
    ⠀⠀⠀⢸⣿⣤⣤⣤⣤⣤⣤⣤⣤⣼⡇⠀⠀⠀
    ⠀⠀⠀⢸⣟⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⠀⠀
    ⠀⠀⠀⠘⠛⠛⠛⠻⢿⡟⠛⠛⠛⠛⠃⠀⠀⠀
    ⠀⢠⣤⣤⣤⣤⣤⣤⣼⣧⣤⣤⣤⣤⣤⣄⡀⠀
    ⠀⠈⠉⠉⠉⠉⠉⠉⢹⡏⠉⠉⠉⠉⠉⠉⠁⠀
    ⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀
    ⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⠀
    ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
    ⠀⠀⠀⠀⠀⠀⠀⠠⢶⡄⠀⠀⠀⠀⠀⠀⠀⠀
    ⠀⠠⣾⡿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⣟⠀⠀
    ⠀⠠⣿⠇⠀⠀⠀⣰⡗⠀⠀⠀⠀⠀⠠⣟⠀⠀
    ⠀⢠⣤⣤⣤⣤⣼⣿⣤⣤⣤⣤⣤⣤⣤⣤⡄⠀
    ⠀⠀⠀⠀⢠⣼⠟⠀⠀⠀⠀⣸⡟⠀⠀⠀⠀⠀
    ⠀⠀⠀⠀⠺⠿⢶⣤⣄⣠⣴⠟⠀⠀⠀⠀⠀⠀
    ⠀⠀⠀⠀⠀⠀⢀⣨⣽⠿⠿⣶⣄⣀⠀⠀⠀⠀
    ⠀⠠⢶⠶⠶⠟⠛⠋⠁⠀⠀⠀⠉⠻⠿⡖⠀⠀
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠛⠉        ⠉⠻⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁              ⠈⠹⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠃                   ⠹⢿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠶⠶⣶⣄⡀                 ⠨⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⢉⣀⣀⡀ ⠹⢿⠆                ⠠⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠋  ⠉⠋⢛⣲⢦⡄   ⠠⣴⣶⣤⣄         ⠠⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟             ⢀⣀⡀⠉⠙⠻⢆⡀      ⢠⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟      ⢀       ⠈⠙⠳⢄⣀ ⠠⠇      ⣸⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠁    ⣀⣠⣼⣷⣤⣄⣀       ⠉⠱⠄     ⢠⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⠁  ⢠⣶⣿⣟⡛⠻⠿⣿⣿⡿⠗             ⢠⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇   ⢸⠿⢟⠋⠉  ⣈⠙⠛⣀            ⠠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇    ⢰⣿⣿⣶⣤⣄⡀⠡⢆⣰⣖⣀         ⠠⡜⠛⣉⣩⣍⢻⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⡖   ⠈ ⠹⠿⣿⣿⣷⣤⣿⣷⡟         ⠐⠡⣞⠉ ⠻⣼⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠁         ⠉⠉⠁          ⠠⡌ ⠉  ⣰⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⡟⠛⠁                         ⣘⡀  ⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⠟⠁              ⠠⣄⣠⣄        ⣰⣿⣷⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣟⠁              ⠠⢶⣾⣿⣿⣿⡮⣔⣠⣄⣀⣀⣠⣴⠿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣶⣆⡀               ⠹⠿⠟⣀⣻⣿⣿⣿⣿⣿⠏⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣆             ⢰⡖⠃⣈⣹⣿⣿⣿⣿⣿⣷⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⡄            ⠠⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣗            ⠠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄          ⠠⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⣿⡟                     ⠠⣾⠟⠛⠉⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
    ⣿⡟⠁        ⢠⣤⣄⡀                  ⠉⠙⠻⠿⠿⢿⣟⣻⣽⣿⣿⣿⣿⣿⣿⠟⠉
    ⡟         ⠠⣾⣿⠟⠋⢸⣆                    ⢠⣌⠙⠉⠻⣿⣿⣿⣿⣿⣟
              ⠠⡏   ⠈⠹⣷⣄                 ⣠⣟⠃    ⠻⣿⣿⣿⡟
               ⠁ ⢠⣄⡀⠠⣿⣿⣷⣤⠤⠴⡤⠄⠠⠦⣶⣦⠤⣤⣤⡤⢤⣴⣿⣿⣟⣠⣶⣟   ⠈⠙⠛⠁
    ⡞          ⡀ ⠨⣿⣿⣆⠻⣿⣿⣿⣇⣠⣶⣶⡾⠿⣿⡟⠻⣿⣿⣷⣄⢻⣿⣟⢻⣿⣿⡏ ⠠⠄
               ⢛  ⠻⣿⣟⡀⢸⡟⠣⢿⣿⣯⣭⣦⣦⣿⣿⣷⡤⠆⠹⠟⠃⠻⢟⣰⣿⡟⠁⣀
               ⢠⣼⡗ ⠛⠫⠗  ⠠⡿⠏⠛⢻⣯⣾⣿⣿⣿⣇   ⢀  ⠉⠛⠁ ⠠⣔   ⠰⣄⡀
               ⢸⣟⠡⡄⠚⠁        ⢹⣿⣿⣿⣿⠏           ⠛    ⠸⢿⡄
          ⠠⣄⡀  ⠈⠃             ⢹⣿⣟⠃     ⠘⠂           ⠸⣿⡄
          ⠠⣿⣿⣶⡄         ⣠⣄⣀   ⠺⢿⡏   ⠠⣤⣶⣦⣄            ⠹⣗
          ⠠⣿⣿⣿⠇        ⠻⣿⣷⣿⣷⣄⡀⢠⣼⣇ ⠠⢴⣿⣿⣿⡟⠋             ⢹
          ⢠⣿⣿⡏          ⠈⠉⠉⠉⠛⠡⣼⣿⢏⣰⡄                   ⠠
        ⠠⣴⣿⣿⣟                ⠠⠿⠟⠚⠛⠃
       ⠠⣾⣿⣿⣿⡏                  ⢀⣀⣀⣀                 ⣀⣠⣴
      ⠠⣼⣿⣿⣿⣿⡇                ⠠⣴⣿⣿⣿⣿⣷⡄            ⢠⣾⣿⣿⣿⣿
      ⠠⣟⡉⠛⠸⣿⡇                ⠠⢿⣿⣿⣿⣿⣿⠇           ⣰⠿⠿⠿⣿⣿⣿
      ⢸⣟⠁ ⠠⣟⡂            ⠁⡀   ⠨⣿⣿⣿⣿⣟           ⠠⢽⣄   ⠉
     ⠠⣿⣏  ⠠⠟⠁            ⠠⢿⣄⣀⣠⣼⣿⣿⣿⣿⣿⢤⣤⡞        ⠠⣿⡏⠉⠓
    ⣠⣼⣿⣟⡀ ⠠⡗              ⠈⢻⣿⣇⠈⠛⠛⠛⠛⠫⣿⡟         ⠠⣿⡇
    ⣿⣿⠿⠿⠇ ⢀⡉                ⢻⡿⢷⣦⣤⣤⣤⡞⠛⠃          ⢸⡇
    ⣿⣟   ⠠⣌⡀                 ⠉ ⠉⠙⠛⠉             ⠈⠁ ⠠⠄⠐
    ⣿⡇   ⠰⡟                                   ⠠⣤⣤⣄ ⢘⡀
    ⣿⣟   ⠠⠟⡀                                  ⠠⣬⣟
    ⣿⣿⡆   ⠺⠇                                  ⢀⠸⣿⣿⣤⣴⣄⣀⣀
    ⣿⣿⣇                      ⡀  ⡀  ⡀           ⡠⢿⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⡄                    ⠺⣿⣿⣿⣿⣷⠟⠁           ⠐⠺⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⡄                                      ⠠⣾⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣗                                       ⢹⣿⣿⣿⣿⣿⣿
    ⣿⣿⣿⣿⣿⡆                                      ⢸⣿⣿⣿⣿⣿⣿
    

(back to top)

Roadmap

  • Convert input image to dot-based text
  • Convert input text to dot-based text
  • Customized parameters for converting images
  • A good GUI

(back to top)

Contributing

If you have a suggestion that would make the project better, please fork the repo and create a pull request.
You can also simply open an issue with the tag enhancement.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Besides, if you find this project useful, don't forget to give it a star !

(back to top)

Contact

Aaron Tsai - aarontsaai@gmail.com

Project Link: https://github.com/tsai8890/LeetTimer

(back to top)

Acknowledgments

(back to top)

About

Convert images to dot-based text.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages