Skip to content

Convert an image to ascii characters... And that's it XD.

License

Notifications You must be signed in to change notification settings

Suazo-kun/Image-to-Ascii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image to Ascii

Convert an image to ascii characters... And that's it XD.

How to use

To use it import in your project imagetoascii and call the function ImageToAscii, this function accepts as first argument a path or an Image type object (from pillow) and as second element the width that the image will have (it only accepts as value a number between 1 and 1000).

Example:

from imagetoascii import ImageToAscii

IMAGE_PATH = "/home/user/images/img.jpg"
WIDTH = 300

result = ImageToAscii(IMAGE_PATH, WIDTH)

with open("ascii-art.txt", "w", encoding="UTF-8") as f:
    f.write(result)

On the other hand, if you only want to use the utility, from the terminal/console run main.py and supply what is requested.

Example:

> main.py
Image path: /home/user/images/img.jpg
Width (1-1000): 300
Result in: /home/user/images/ascii-art.txt
--- Sucess ---

Requeriments

  • Pillow

    python3 -m pip install pillow

About

Convert an image to ascii characters... And that's it XD.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages