False coloring a video in real time using lookup tables
I've been working on OpenGLES very intensively for video rendering and applying real-time filters for months, and I haven't yet put up a blogpost on one of my favorite filters yet. I love it because it shows how fast and simple things can be in the GPU if you know how to use it well; What you have to do is given a greyscale image, false color it with a provided mapping from grayscale to RGB values; i.e., Grey [0,255] --> R [0,255], G [0,255], B [0,255] In a traditional CPU world, this is fairly simple. All you have to do is loop the image for each pixel, and use the mapping to convert the grey pixel to an RGB. But this is insanely slow, and cannot be done in real time. In comes the GPU! It's perfect for repetitive tasks, like this simple image processing problem where you have to apply the same function to every pixel of an image. Here's what the output looks like. The center image is the original greyscale image. My favorite color palette is the one o