Skip to content
Sai-DeepanPublic

About

Grain is a Python-based tool that transforms images into ASCII art using PIL.Image. It processes images pixel by pixel, maps brightness to characters, and outputs clean, character-based art.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASCII Image Converter

Convert any image into ASCII art using Python.

How It Works

  1. Load an image using PIL.Image.open()
  2. Resize and convert to grayscale
  3. Map pixel brightness to characters from a custom ASCII set
  4. Optional: Skip background based on user input (white or black)
  5. Output formatted ASCII string to ASCII_img.txt

Image1 -

Image2 -

Features

  • Converts .jpg, .png, and other image formats
  • Optional background filtering (white or black)
  • Accurate aspect ratio fix for terminal display
  • Outputs clean .txt ASCII file
  • Easily customizable width and ASCII characters

Requirements

  • Python 3.x
  • Pillow

About

Grain is a Python-based tool that transforms images into ASCII art using PIL.Image. It processes images pixel by pixel, maps brightness to characters, and outputs clean, character-based art.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages