Warning: this document is still work in progress. Feel free to send comments but do not consider it final material.

>>> Colour quantisation

Libcaca study: the science behind colour ASCII art

This document is an attempt at extending the leverage of skilled resources by uncovering and addressing the challenges the industry faces today in the area of colour ASCII art generation.

Seriously, guys. If you think that what libcaca does is easy, you either don’t know what you are talking about, or we want you in the team.


Meet Lena. She will guide us through this document, because the seriousness of a scientific document in the area of computer graphics can be measured by the number of times Lena appears in it. She truly is the Mona Lisa of image processing. [2]

Lena (256×256) colour gradient (64×256) Lena (256×256BW) greyscale gradient (32×256)

This document makes a lot of assumptions, such as the fact that input images are made of pixels that have either one (grey level) or three (red, green and blue) values uniformly spread between 0 and 1 (with regards to human contrast perception). Real life is more complicated than that, but that is beyond the scope of this document for now.

Table of contents

>>> 1. Colour quantisation