Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mirtia/ascii-art
Turning .jpeg , .png and .mp4, .gif files to ASCII art
https://github.com/mirtia/ascii-art
ascii-art for-fun gif image-processing opencv
Last synced: 5 days ago
JSON representation
Turning .jpeg , .png and .mp4, .gif files to ASCII art
- Host: GitHub
- URL: https://github.com/mirtia/ascii-art
- Owner: Mirtia
- License: mit
- Created: 2023-07-14T00:24:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-20T15:12:57.000Z (over 1 year ago)
- Last Synced: 2023-07-20T16:33:18.191Z (over 1 year ago)
- Topics: ascii-art, for-fun, gif, image-processing, opencv
- Language: C++
- Homepage:
- Size: 14.3 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ASCII art
## Usage
```c++
"YOUR_PATH_HERE/ascii-art.exe" --input=input/osaka.jpg --font=fonts/Consolas.ttf --output=output/osaka.jpg --background=#edcaeb --color=#db6bbc"YOUR_PATH_HERE/ascii-art.exe" --input=input/707.gif --font=fonts/Consolas.ttf --output=output/707.mp4 --color=#e63959
"YOUR_PATH_HERE/ascii-art.exe" --input=input/smile-pepe.gif --font=fonts/Consolas.ttf --output=output/smile-pepe.mp4
"YOUR_PATH_HERE/ascii-art.exe" --input=input/lain.png --font=fonts/Consolas.ttf --output=output/lain.png --background=#ede6d1 --color=#3d1d38
```## Output
| | |
|:---------------:|:---------------:|
| ![707](output/707.gif) | ![pepe](output/smile-pepe.gif) |
| ![osaka](output/osaka.jpg) | ![lain](output/lain.png) |
## NotesTo use freetype you have to download the following libraries. I used *vcpkg* for package management.
```bash
# VCPKG_DEFAULT_TRIPLET
vckpg install harfbuzz
vckpg install freetype
```Then, when configuring the build files you have to enable ```WITH_FREETYPE``` option. I also had to modify the ```CMakeLists.txt``` in OpenCV contributions [```/modules/freetype/CMakeLists.txt```](https://gist.github.com/UnaNancyOwen/14c72a3f10a46d41c359ab6ea307a1d2) to make it work.
Moreover, there were a ton of missing .dll files such as *libopenh264* and there was no *GIF* file support from the standard OpenCV library. So, I just used [**ffmpeg**](https://ffmpeg.org/download.html) as a command line tool to convert resulting *.mp4* to *.gif*.