Skip to content

ViniGodoy/img2txt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

img2txt

Converts an image to an ascii art text. This code was created for my image processing classes at PUCPR. That's why grayscale conversion and shrinking are manually implemented.

This code uses two different processes:

Method 1: Luminosity mapping

  1. Create a character palette based in char luminance (see makePallete method)
  2. Shrink the image with 2x4 slots
  3. Convert to 10 shades of gray with dither
  4. Map them to the character pallete

Method 2: Shape mapping

  1. Shrink the image to with 1x2 slots
  2. Binarize the imagem with dithering
  3. Analyze the shape of a 2x2 pixel slot
  4. Map to the closest letter format

See toText1.txt and toText2.txt for results after processing images/jobs.jpg

About

Converts an image to an ascii art text

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages