Skip to content

mmarica/python-img2text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image to Text

Convert images into ASCII art. This script has been tested with Python 2.7.

Requirements

This script requires:

  • Python 2.x (tested with 2.7)
  • Pillow
  • ArgumentParser

Dependencies can be installed using Pip. To install Pip on Ubuntu, run this command:

sudo apt install -y python-pip
sudo -H pip install -U pip --upgrade pip

Install setup-tools using pip:

sudo -H pip install -U pip Pillow ArgumentParser

Example usage

$ python img2text.py samples/bird.png --inverted
                                                             ▒▒
                                                           ░▓▓▓
                                                         ░▓▓▓▓▓
                                                       ░▓▓▓▓▓▓▒
                                                     ░▓▓▓▓▓▓▓▒░▒▒
                                                   ░▓▓▓▓▓▓▓▓▓▓▓▓▓
                                                 ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
                                               ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
                                             ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░
                                           ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
                                         ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░
                                       ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░
                                     ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░
                                   ░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░
             ░░▒▒▒▒▒░░            ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
           ░▒▒▒▒▒▒▒▒▒▒▒▒▒░      ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
          ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░  ▒▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░
          ▒▒▒▒▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▒░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒░
         ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
   ░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
         ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░
          ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░
          ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░
            ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░▒▒░
            ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░
             ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
              ▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒
               ▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
               ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░
                ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒░░
                 ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ ░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
                  ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ░░░▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░▒▒░░
                   ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░▒▒░░ ░░░
                    ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░▒▒▒▒▒░
                     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
                       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░
                         ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░▒▓▓▒▒▒░░
                           ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░       ░▓▓▓▒▒▒░░
                               ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░             ░▒▓▓▓▒▒▒▒░
                                                                  ▒▓▓▓▓▒▒▒▒░░
                                                                   ░▓▓▓▓▒▒▒▒▒░░
                                                                     ▒▓▓▓▓▒▒▒▒▒▒░
                                                                      ░▓▓▓▓▓▒▒▒▒▒▒░░
                                                                       ░▒▓▓▓▓▓▒▒▒▒▒▒
                                                                         ▒▓▓▓▓▓▒░
                                                                          ░░▒▓▓▓▒


About

Convert images into ascii art

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages