The Well-Tempered Palette

July 10, 2018

When we use false color to encode useful information in an image, it helps greatly if the colors are meaningful in themselves (like a rainbow to encode heat) or maximally different when the image is segmented (like a map showing geologic provinces). But how do we chose those maximally different colors?

Somehow, we need a maximally distributed set of points in RGB space (but not necessarily RGB). We might have just what we need for this! We’ve discussed Halton sequences before. They’re a simple way of progressively and uniformly distribute points over an interval. The sequence starts by the ends of the interval then progressively fills the gaps. It generates the sequence 0, 1, 0.5, 0.25, 0.75, 0.125, 0.625, 0.375, 0.875, …

Read the rest of this entry »

Pantone Colors (Colorspaces X)

June 19, 2018

Let’s have a look at another physical colorspace: Pantone.

The Pantone color system isn’t particularly useful for us as it is mainly concerned with “real world” colors, as in print. It also uses a variety of special dies, for metallic or fluorescent finish. It does, however, allow very accurate and consistent color reproduction for packaging, posters, and comics.

Read the rest of this entry »


November 14, 2017

Since we now have minimal ANSI support, we can use it. Of course, for cute things such as changing text color (red for error, green for OK, etc.), but that’s not very amusing. Let’s make some ANSI ART!!1!

Read the rest of this entry »

ANSI soit-il.

October 24, 2017

There’s no easy way of getting a console-based color output with standard C++. Of course, you can use ncurse, which does pretty much everything, but that is also quite tedious to use. But if you need just a little bit of color, ncurse is pretty overkill. Fortunately, if you have an ANSI capable terminal, that’s much easier.

Read the rest of this entry »

X marks the spot

March 3, 2015

I’m presently finishing a large text typeset in LaTeX. Of course, in many places I just put a note to “fill later” and moved on with the rest of the text. But now, I must hunt them down and fill the holes.

Good for me, I had the idea of writing a LaTeX command that not only marked the spot in the rendered page, like this:


…but also, by using the command itself, marked the spot in the source code itself. Otherwise, I’d have to find all the “fill me later” “add more” and whatnots.

The command itself is really not that complicated:



\newcommand{\fillme}[1]{\textcolor{bloodred}{\smash{\ding{54}}}\message{Forgotten fillme on input line \the\inputlineno}} % 54 big fat X

The command takes an argument, which is ignored, but is quite convenient to leave the future you a message:

\fillme{blurb something about leibniz vs newton}

The command depends on the packages pifont for the dingbat and xcolor to define a nice dark red. The command itself does two things. One is to typeset a blood red X in the generated document so that it is conspicuous. The other is to output a message that can be parsed automagically by a script, making their eradication easier.


January 6, 2015

I’ve been using fountain pens for a long time, but I only recently began to appreciate ink. Yes, there are more colors than black and blue-black.


One of the more difficult thing is to choose a color that actually pleases you. Of course, you can browse online stores to get ink, but the colors presented in the swatches are not all that fateful to the actual color you will get out of your fountain pen. Sometimes you have a nice surprise, sometimes you’re disappointed.

Read the rest of this entry »

Bad Graphs!

July 17, 2012

One of the good things of the peer review process is that if you publish, you’re eventually going to have to review papers for conferences or journal in your (perceived) area of expertise. Sometimes you get pearls such as “the resulting results of algorithm X are resulted” (true story), or “the dynamics of the attorney of yes no plasmodium” (also true), but sometimes bad science comes from the bad presentation of results.

This is also a (essentially true) story. So I’m reviewing a paper that proposes some kind of method for predicting the value of (some) parameter that minimizes some error function. The method is fast, but not analytic. The graph in the paper looks something like:

Read the rest of this entry »