A customisable script to transform images into ASCII art.
| Input image | Output ASCII |
|---|---|
- Clone the repository:
git clone git@github.com:hwixley/ascii-art-generator.git - Install the dependencies:
pip3 install -r requirements.txt
You can run the script using shell:
chmod +x ascii-art-generator.sh && ./ascii-art-generator.sh
Or using python:
python3 src/ascii_art.py
All the following arguments are optional.
-
Image: the path of your input image, defaults to Nick Cage.
-i <img_path>or--img <img_path> -
Image Width: the "ASCII pixel" (two horizontally adjacent ASCII characters) width of your output ASCII image, defaults to
80.-w <img-width>or--img-width <img-width> -
Charset: the size of charset for your ASCII image (options:
tiny,small,medium,large), defaults tosmall.-c <charset>or--charset <charset> -
Sampler: the pixel density sampler type (options:
linear,log,exp), defaults tolinear.-s <sampler>or--sampler <sampler> -
Lower Bound: the lower bound of pixel density sampling, defaults to
0.2. Bounded in the range [0,1].-l <lower-ptg>or--lower-ptg <lower-ptg> -
Upper Bound: the upper bound of pixel density sampling, defaults to
0.4. Bounded in the range [0,1].-u <upper-ptg>or--upper-ptg <upper-ptg> -
Save/generate image: if specified will put the ASCII art into a PNG.
-gor--gen-img
-
Help: lists available arguments.
-hor--help -
Version: lists current version.
-vor--version