Convert an image to ANSI escape codes

I’ve been working on cleaning up my dotfiles recently and have been playing with my PS1 and the available colours. In doing so I thought it might be interesting to extract image data from an uploaded image and turn the result into a nearest-match ANSI image. This is the result! It supports both 256 colour and true colour terminals and can utilise unicode code points to present a clear image in slightly fewer pixels as well as just using background colours and spaces if preferred.

It includes a live preview which I’ve lifted from the bash PS1 parser.

Check it out here!

One Reply to “Convert an image to ANSI escape codes”

Leave a Reply

Your email address will not be published. Required fields are marked *