https://github.com/juselara1/asciigen
Ascii art image generator
https://github.com/juselara1/asciigen
Last synced: 4 months ago
JSON representation
Ascii art image generator
- Host: GitHub
- URL: https://github.com/juselara1/asciigen
- Owner: juselara1
- Created: 2022-04-22T22:11:19.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-22T22:20:40.000Z (about 3 years ago)
- Last Synced: 2024-12-31T11:58:33.522Z (5 months ago)
- Language: Python
- Size: 6.84 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# asciigen
This is package allows to convert images into ascii art using `numpy` and `opencv`.

## Installation
* You can install this package via `pip`:
```sh
pip install asciigen
```* Installation with `poetry`:
```sh
poetry add asciigen
```## Usage
You can use `asciigen` as a cli:
```sh
> asciigen --helpusage: asciigen [-h] [-i INPUT] [-o OUTPUT] [-l HEIGHT] [-w WIDTH] [-c COLORSCALE]
Generate ASCII art from images.
optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
Input image file.
-o OUTPUT, --output OUTPUT
Output file.
-l HEIGHT, --height HEIGHT
Height of the output image.
-w WIDTH, --width WIDTH
Width of the output image.
-c COLORSCALE, --colorscale COLORSCALE
Color scale to use.
```## Usage
Suppose you have the an image saved as `sample.jpg`, you can render this image as follows:
```sh
asciigen -i sample.jpg
```You can change the shape of the image:
```sh
asciigen -i sample.jpg -l 256 -w 256
```You can specify an output file to save the text:
```sh
asciigen -i sample.jpg -o output.txt
```Finally, you can change the colorscale or the ascii characters that are used to build the image:
```sh
printf "@. " > scale.txt && asciigen -i sample.jpg -c scale.txt
```