Coders Packet

Image to ASCII Art using Python

By MD Mubasheer Azam

Image to ASCII Art using Python is a project that converts an image into ASCII art, a graphical design technique that represents images through characters.

Image to ASCII Art

Transform your favorite images into captivating ASCII art with `Image To ASCII Art`.

 

About the Project

This project takes a picture you like and turns it into something different but fun. First, the computer makes the picture smaller if it's too big. Then, it looks at each tiny dot in the picture, one by one. Each dot has a brightness level, and the computer picks a letter or symbol based on how bright the dot is. After looking at all the dots, it puts these letters together to make a new picture. This time, instead of colors and shapes, the picture is made of letters and symbols! You can see this new picture on your computer screen or save it as a file. It's like turning your picture into a secret code made of letters and symbols, adding a fun twist to your images!

 

Features

- Effortlessly convert any image format (JPG, PNG, etc.) into stunning ASCII art.
- Seamlessly save output to a text file, simplifying sharing and storage.
- Flexibly adjust output width to cater to your preferred display dimensions.

 

Installation

1. Ensure you have `Pillow` installed. If not, install it via pip:

~ pip install Pillow

Usage

1. Execute the script:

~ python main.py

 

2. Input the path to your desired image for conversion.

3. Retrieve the generated `ascii_output.txt` file from the same directory, showcasing your masterpiece in ASCII.

 

Customization

Tailor the output width to your liking by adjusting the `output_width` parameter within the script.

(default is set to 100)

 

Additional Notes

- Experiment with different images to witness diverse ASCII renditions.
- Share your ASCII creations with friends and on social media platforms for added enjoyment.

 

Example Screenshots of the working project are attached below: 

Code of the project

 

Example picture used for Image to ASCII Art

 

Output of the program

 

Download Complete Code

Comments

No comments yet

Download Packet

Reviews Report

Submitted by MD Mubasheer Azam (Mubasheer007)

Download packets of source code on Coders Packet