Skip to content

sleepyme06/numpie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

ASCII Art Generator

A Python script that converts images into ASCII art using NumPy. This program transforms regular images (.jpg, .png) into text-based art using ASCII characters like @, #, *, .. The output can be viewed in a terminal or saved to a text file.

How to Use

  1. Place your image in the project/op&ip folder
  2. Run: python ascii_art_generator.py
  3. Find the output in project/op&ip/output_art.txt

Example Images

Input Image

Output ASCII Art

Project Structure

numpy/
│
├── project/
│   ├── ascii_art_generator.py
│   └── op&ip/
│       ├── output_art.txt
│       ├── output_art_1.txt
│       ├── output_art_2.txt
│       ├── sample.jpeg
│       ├── sample_1.jpeg
│       └── sample_2.jpeg
│
└── README.md

Implementation Details

  1. Image Loading: Uses PIL to load image into NumPy array
  2. Grayscale Conversion: Applies RGB weights (0.2989R + 0.5870G + 0.1140B)
  3. Downsampling: Reduces image size for terminal display
  4. ASCII Mapping: Maps pixel values to ASCII characters
  5. Output Generation: Saves result to text file

Key Features

  • Configurable downsampling factor
  • Customizable ASCII character set
  • Supports common image formats
  • Efficient NumPy-based processing

Requirements

  • Python 3.x
  • NumPy
  • Pillow (PIL)

About

this repo is abt numpy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages