Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 2.47 KB

README.md

File metadata and controls

66 lines (47 loc) · 2.47 KB

OpenCV Nix Flake Python: 3.12 Code style: black

TOC

  1. features
  2. examples
  3. usage
  4. other tools

ASCII_IMG - Advanced IMG to ASCII pipeline

With this tool you should be able to convert any image to a good ascii art with configurable characters and a configurable processing pipeline.

So far countless tools seemed to exist, but i did not find one, that uses edge detection to use fitting characters that follow an edges direction, an already solved problem in image recognition applications (besides Acerolas ASCII shader ofc, but thats a shader and not a program that outputs text).

I also needed to find at least one use for the image processing classes i had, as they seemed kind of pointless so far; after watching the infamous Acerola video i also noticed how simple the processing actually is.

(Planned) Features

  • segmentation step for the foreground object
  • edge detection and fitting characters
  • brightness based characters (10 levels so far)
  • truecolor escapes for colored pixels
  • configurable kernel sizes
  • color binning
  • properly deal with terminal fonts (they are not 1:1)
  • GUI/TUI with live reload
  • Automatic Kernel size selection (in CLI/TUI)
  • export as script for neovim dashboards(?)

If you feel like smth is missing open an issue.

Examples

Source Image

python -m ascii_img flower.jpg brightness,edge,color -d 7 -s --bg -t 150

ASCII Version

python -m ascii_img flower.jpg brightness,color,edge -d 9 -

ASCII Version with highlighted edges

Usage

This is still in an early version, so the usage is not finalized, for now you have to use -h and look at the source for the modes (main function in __init__.py).

Other tools i have looked at

ascii2img: mostly uses braille, does not do edge detection asciiart.eu: online tool, preprocessing steps and configurable character sets, but does not do colors