Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.09 KB

README.md

File metadata and controls

39 lines (29 loc) · 1.09 KB

ASCII Art

A simple program that turns images into ASCII-art

Instructions:

  1. Upload an image to the img directory.

  2. Update configs at the beginning of the script.

  • IMAGE_IN_PATH: path to original image
  • IMAGE_OUT_PATH: path to generated image
  • STRATEGY: strategy to map RGB values to brightness (default = 1)
    • 1 = Average
    • 2 = Luminosity
    • 3 = Lightness
  • OUTPUT: whether to create a new image or print to terminal (default = 1)
    • 1 = Image
    • 2 = Terminal
  • FONT_SIZE: font size of ASCII characters (default = 8)
  • FONT: font family (default = DejaVuSansMono)
  • MAX_WIDTH: maximum width allowed for conversion (default = 400)
    • If the image's width is greater than this value, image size is reduced
  1. Run the script.
python3 script.py

Example

Original Image:

original_image

ASCII Image:

ascii_image

Credits

Inspired by: Robert Heaton's Programming Projects For Advanced Beginners