Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bigsk1/airats
ASCII Image Convertor
https://github.com/bigsk1/airats
ascii ascii-art command-line flask homelab image-processing linux python python3 self-hosted
Last synced: 27 days ago
JSON representation
ASCII Image Convertor
- Host: GitHub
- URL: https://github.com/bigsk1/airats
- Owner: bigsk1
- License: mit
- Created: 2023-04-02T07:34:17.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T12:59:33.000Z (7 months ago)
- Last Synced: 2024-12-05T07:02:36.050Z (about 1 month ago)
- Topics: ascii, ascii-art, command-line, flask, homelab, image-processing, linux, python, python3, self-hosted
- Language: Python
- Homepage:
- Size: 19.8 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# AIRATS
## ASCII Image Convertor
![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)A simple Flask web app and command-line tool to generate ASCII art from an image URL or locally.
Both Web and Command Line usage
![fish](/images/fish.jpg)
Turn any image locally or remotely into ASCII characters.
# Installation
## Docker
```bash
docker pull bigsk1/airats:latest
```
or
Build docker image in project root with DockerfileClone the repo then
```bash
cd airats
``````bash
docker build -t .
``````bash
docker run -d -p 5000:5000
```## Linux
![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)
1. Clone the repo
```bash
git clone https://github.com/bigsk1/airats.git
```
```bash
cd airats
```2. (Optional) Create a virtual environment and activate it:
```bash
python3 -m venv venvsource venv/bin/activate
```3. Install the required Python packages:
```bash
pip install -r requirements.txt
```## Ubuntu 22.04+
![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=white)
### If you don't want the virtual enviroment just make sure you have installed```bash
sudo apt install python3 && sudo apt install python3-pip && sudo apt install python3-flask && python3 -m pip install Pillow && python3 -m pip install requests && python3 -m pip install gunicorn
```
run with python3 app.py in the airats folder```bash
python3 app.py
```
Open a web browser and visit [http://localhost:5000](http://localhost:5000) to access the app.## Devcontainer VScode
Open in devcontainer and run! Find on localhost:5000
---
## Windows 64bit install
![Windows 11](https://img.shields.io/badge/Windows%2011-%230079d5.svg?style=for-the-badge&logo=Windows%2011&logoColor=white)Download .exe from releases here: https://github.com/bigsk1/airats/releases/tag/v1.0
You will most likely get a warning when trying to launch because it is not a signed .exe this is normal.
(optional) build your own by cloning the win64 branch here:
```bash
git clone --single-branch --branch win64 https://github.com/bigsk1/airats.git
```
see the requirements.txt for what dependencies are needed# Usage
## Linux
### Web Interface virtual environment in Python
1. Run the Flask app (optional):
```bash
export FLASK_APP=app.py
```
```bash
flask run --host=0.0.0.0
```2. Open a web browser and visit [http://localhost:5000](http://localhost:5000) to access the app.
3. Enter an image URL and width, then click "Generate ASCII Art" to see the result.
## Command Line
Run any of the following commands from the airats directory:
python3 Main.py [-w WIDTH] [-ht HEIGHT]
### Image size can be changed as needed
You can also run an image you have locally using:
python3 Main.py your_image.jpg -w 150 -ht 50
or
python3 Main.py https://your-image-url.jpeg -w 150 -ht 50
```bash
python3 Main.py images/rat.jpg -w 50 -ht 25
```Output image to a file
```bash
python3 Main.py images/rat.jpg -w 80 -o output.txt
```Supports
JPEG: .jpg, .jpeg
PNG: .png
GIF: .gif
BMP: .bmp
TIFF: .tif, .tiff
ICO: .ico
WebP: .webp![Rat Image](/images/rat.jpg)
```bash
`,^.`:l!<;,^' .I,
!-})}rcYCQLYzvt(]?[{;
"+<+}}{ruYQQQ0QJvft?--`
ir1_-)jrzvucccJZwQvnj?}(,
.-CZJf[}rcnuzLu/tjnzvrYYcYtl
.1QQCL0XcnrxuO#pCjf/(|fcpXYCx,
]CLXcccXJYJJXzcrttt({[{|/vLQL/^
+JLcrrnvYLCL0QLJCzt)]?[}}-)COLJ}`
!XZQcjrvXYCQQOO0QJu(}]?{?]?+zO0Lc>
`tL00XnjncvcczXXXvf/|{[])()[]zLCXX{
"rYYJYznxnvczzvuuuj({}]??][)uJCXvct'
,jXXYzcvnnvzXJJJYYzvf/|fnzYCQYYzuvn^
.~ncccunuvcXJJXXYJ0mOqZZ00QO0JzvuvvI
'?xrrjrzOZJvcvXQOdkhadmQLLLLCznxczI
~jrjt{)vQcvvut){(c0ZOQLLQQCcnuXX,
^l>+]{){]_!,l[/)This project is licensed under MIT License.