Image to ASCII

Image to ASCII

3 devlogs
1h 23m
Created by Draedon

A simple tool to convert images to ASCII, built with only TypeScript and without any libraries

Timeline

Technically works now! It was super easy to convert the brightness values into text. I just found a palette of characters and put them all into a string, side by side. Then, to figure out which one to use, I just indexed into it with an index of: floor(brightness * (palette.length - 1)). This essentially maps the brightness values from [0, 1] to [0, pallete length - 1], allowing it to index the big palette string. Next up is setting a custom width because currently, the generated images are MASSIVE

Update attachment

Grayscale conversion works! This was super simple to get working: average the red, green, and blue components and multiply by the alpha. I might try different colour spaces in the future, such as Oklab

Update attachment
Earned sticker

Implemented a simple drag and drop functionality for files! It's been ages since I've done this so I had to do a bit of googling for this one. Next up is probably loading the image and getting the brightness of each pixel in preparation for turning it into ASCII

Update attachment