https://github.com/shahank42/img2ascii
An application to render bitmap image files as ASCII characters.
https://github.com/shahank42/img2ascii
ascii-art ascii-graphics bitmap-images cli-app computer-vision cpp pixel terminal
Last synced: 2 months ago
JSON representation
An application to render bitmap image files as ASCII characters.
- Host: GitHub
- URL: https://github.com/shahank42/img2ascii
- Owner: shahank42
- License: gpl-3.0
- Created: 2022-10-13T14:49:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-13T15:22:39.000Z (over 3 years ago)
- Last Synced: 2024-10-11T14:16:11.438Z (over 1 year ago)
- Topics: ascii-art, ascii-graphics, bitmap-images, cli-app, computer-vision, cpp, pixel, terminal
- Language: C++
- Homepage:
- Size: 3.02 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# img2ascii
A program to render bitmap image files as ASCII characters.
# Usage
Download the latest version from the .
Simply drag-and-drop the bitmap image file onto the executable file, and fill in the appropriate parameters.

* Image Contrast Factor should be a value between 1 and 255.
# Implementation Details
This project was really more of an effort to show that no external libraries should be necessary for image processing; that everything can be achieved through vanilla C++17.
In hindsight this philosophy was erroneous and it is definitely better to use an existing library such as OpenCV for this purpose, and in general any other computer vision related projects.
Some of the resources and repositories I used are listed under:
* https://www.scratchapixel.com/lessons/digital-imaging/simple-image-manipulations/reading-writing-images: To get an idea of the general projet structure, and find out the various techniques used in computer vision.
* https://www.dfstudios.co.uk/articles/programming/image-programming-algorithms/image-processing-algorithms-part-5-contrast-adjustment/: For the contrast adjustment algorithm.
* https://github.com/kbuffardi/Bitmap: For the code on loading bitmap images. Thanks a bunch!
* https://bitesofcode.wordpress.com/2017/01/19/converting-images-to-ascii-art-part-1/ and https://bitesofcode.wordpress.com/2017/05/27/converting-images-to-ascii-art-part-2/: Super helpful write-ups that explain the entire workflow of the program in an easy-to-understand fashion.
# Known Issues
* No user input validation done yet (so it's super easy to break the program).
* Providing an ASCII Image Width longer than the actual number of horizontal pixels in the image causes a memory leak, and temporary freezing of the OS.
* Slight perspective issue for vertical images (width < height), still thinking of an algorithm that can adjust ASCII-Image proportions to look natural according to a provided constant factor (squishification factor?).