Convert Black/White footage to thermographic-like video

I am doing some really cool research lately concerning video conversion and one of the issues I ran into concerns infrared imaging. In short: all the ‘cool’ thermographic (colour is dependent on radiated temperature) images are in color, and the images you get from cheap IR cameras is black and white. How do you convert the B/W into colour?

First of all: we’re talking about two different imaging technologies: the ‘real’ thermographic cameras measure only infra-red (not visible) light, are very precise, expensive and are created by companies like FLIR. They make the cameras that you might have seen in CSI.

On the other hand, you have the cheaper webcam/IP-cam devices that have ‘night-vision’. This means that, in addition to all visible light, the cameras are also sensitive to a part of the IR spectrum, and with some additional IR-lighting, one is capable of seeing in very dark places. They produce B/W images or colour, but then sometimes they show green grass as a bit purple/pink.

What I was trying to do is convert a ‘cheap’ B/W video into the coloured thermographic equivalent, but without expecting that e.g. orange will always mean 38°-39°. Since we start from a mixed visible/IR light video, brightness does not correlate perfectly with temperature. Still, the end result might be easier to interpret.

So this is my source material: a Foscam FI8918W video from Youtube: two cats playing in a kitchen.

I find some inspiration from a guy who did something similar with ImageMagick. The dark/cold areas are supposed to be black/blue, the medium areas more green, then going to yellow, orange, red and white. This seems like a job for the FFMPEG video filter.

I use the ‘curves’ filter and try first with really strong contrast colours:

The color scheme is kind of OK, but we lose a lot of detail (the cats become hard to distinguish). So then I try a more gradual approach:

And this is rather OK. I like it. The cats come out nice.

For the record: the curves used are approximately this:

curves=r='0.4/0 0.6/1':g='.25/1 .75/.5 .9/0 1/1':b='0/1 .25/0 .75/0 1/1'

All scripts and parameters are on my GitHub account:


Weekday colours (Ayurveda)

My girlfriend recently introduced me to the fact that the days of the week have associated colours, and that one might take these into account when choosing what to wear, to eat or  -in my case- what to drink. The colours are defined by the Ayurveda, the “ancient system of health care that is native to the Indian subcontinent“.

Since I always forget what colour of underwear to put on on which days, I’ll write it down here:
ayurveda colors

Monday: Lord Shiva rules on Mondays. White is the colour for Mondays and therefore wearing white dresses and keeping white flowers at home are recommended on Mondays. It is a good day for men seeking favours from women and for making new friends. Taking honey and cucumber on Mondays is likely to yield good results. Continue reading Weekday colours (Ayurveda)

Shades of purple

Have you ever gotten into a discussion with a woman on colours? It seems that, while some people have ‘absolute hearing’ (pinpoint any frequency to the right note), there is also a kind of ‘absolute colour perception’, and women seem more often blessed with it. While us men have the habit of calling anything with a red/blue mix ‘purple’, life is actually not that simple. There is violet, mauve, orchid and half a dozen variations on those.

To make things even more difficult for Belgian men: we actually have two words in Dutch: ‘paars’ is the equivalent of ‘purple’ in English, while ‘purper’ is more like magenta. Ask any man here (that’s not a fashion designer or hairdresser) the difference between ‘purper’ and ‘paars’ and you’ll get utter astonishment.

So here’s a reference chart of purples:

If any woman/color-sensitive man would like to point out more variations of purple-ish colours, be my guest!

When (if) Spring comes, these are its Pantone colors

According to Pantone, Inc., the global authority on color and provider of professional color standards for the design industries, blue dominated the palette, with three shades – Deep Ultramarine, Skyway and Blue Tint – placing in the top 10
from Pantone website

I took the liberty of converting them to RGB with the CMYK-RGB Converter:
Continue reading When (if) Spring comes, these are its Pantone colors

‘Moroccan Blue’ Leads Top Fashion Colors (RGB)

Moroccan Blue topped the list of colors at New York Fashion Week’s Fall 2005 collections, according to Pantone, Inc., the global authority on color and provider of professional color standards for the design industries.
Each season, Pantone surveys designers showing at New York Fashion Week and collects feedback on prominent collection colors, color inspiration, color philosophy and each designer’s signature shades. This information is used to create the PANTONE Fashion Color Report.
The top 10 most directional women’s ready-to-wear colors for Fall 2005 (along with printing values) are
(converted by me to RGB):

Color Name Pantone RGB
Moroccan Blue PANTONE 19-4241 #004D7A
Glazed Ginger PANTONE 18-1154 #BA5D00
American Beauty PANTONE 19-1759 #BF0000
Ruby Wine PANTONE 19-1629 #730028
Atmosphere PANTONE 16-1406 #B2A68F
Burnt Olive PANTONE 18-0521 #466900
Gloxinia PANTONE 19-3022 #5600A6
Rattan PANTONE 14-1031 #DACE3D
Moss PANTONE 16-0532 #9DA600
Burnt Orange PANTONE 16-1448 #ED7700



Poor-man’s sepia conversion

Working for Pixagogo makes digital imagery my daily bread, and I fool around with images every now and then. I am, however, not a user of PhotoShop. I’ve never worked with it, I don’t own the software, nada. Keep that in mind while you continue reading this.

Recently, for my cousin’s filmfilostoverij blog, I converted some film snapshots into small thumbnails like the one on the right (from “Lucia y el sexo”). The program I use for conversion is IrfanView. Not the best program, not the most complete, but easy, stable and free. For the stuff I need to do, I find Gimp too complex.

What I did to the images was:

  1. crop a square part of it
  2. convert to grayscale
  3. resize to 400×400 px
  4. perform a median filter (value: 9)
  5. resize to 100×100 px
  6. Save as JPG

But then I wanted to have a ‘sepia‘ effect. Irfanview does not have it. I wanted it. So I began my quest.

I started with the ‘Enhance Colors’ function and added 64 ‘R’ and 16 ‘G’ to the B/W image, but that didn’t look real enough. What does sepia look like, anyway? I found two definitions, expressed in CMYK coordinates, that I converted to RGB with my CMYK-to-RGB converter hizmo (thanks to Wikipedia):

The color
1. definecolor{Sepia}{cmyk}{0,0.83,1,0.70} (from TexCeh)
#4D0D00 (77,13,0)
2. sepia cmyk(0%, 60%, 81%, 63%) (from
#5E2612 (94,38,18)
In ‘websafe‘ colors, this would be:
#551100 (84,17,0)

So let me show you how I proceeded, using an image of my tango teachers, Marisa y Oliver:

original image
  1. Convert to greyscale
  2. Enhance colors: 94-38-18 (#5E2612)

=> way too red!

  1. Convert to greyscale
  2. Enhance colors: 77-13-0 (#4D0D00)

=> color OK, but too light

  1. Convert to greyscale
  2. Enhance colors: 77-13-0 (#4D0D00)
  3. Add 50% contrast

=> looks great

    Compare this with the optional QuickSepia plugin

=> I like mine better

Voila, there it is, a simple poor-mans sepia, that can even be used in ‘batch convert’ (Irfanview).

Short CMYK/RGB explanation and Detailed CMYK/RGB explanation

[Listening to: “The Prettiest Thing” – Norah Jones – Feels Like Home]