Tag Archives: colour

How to convert a Lightprobe into the 9 spherical harmonics coefficients

Here is a tutorial on how to convert your own Light Probe into the 9 coefficients needed into my ft-SSIBL plug-in (Screen Space Image Base Lighting).

Links :

I’m sorry for the poor sound, I hope you will still be able to understand !

Pixel Bender : ft-ColorGray shader for After Effects


This shader will color an image based on a second input. I did it because I wanted to change grayscale into a variety of colors with a gradiant.

Download & Sources

How to install it ?

Just copy the .pbk file into your “Support Files” folder in your AE install directory


Pixel Bender : ft-SSIBL (Screen Space Image Base Lighting) shader for After Effects


ft-SSIBL for “Screen Space Image Base Lighting” is based on a topic I covered in a previous post about Roy Stelzer’s “2.5D Relighting inside of Nuke”.  In this shader I tried to reproduced a few approach found in his Nuke script. So with a Normal pass (object or world), you will be able to do some relighting with a HDR map. The shader won’t compute the 9 coefficients (spherical harmonics) needed for you as describe in this paper : http://graphics.stanford.edu/papers/envmap.

The default value are from the Grace Cathedral, San Francisco Lightprobe http://www.debevec.org/Probes/

Download & Sources

I will for sure add more feature to this one in the future, so come back check it out

How to install it ?

Just copy the .pbk file into your “Support Files” folder in your AE install directory

How to use it ?

How to convert a Light probe into the 9 spherical harmonics coefficients ?

Here is the tutorial


Pixel Bender : ft-2-strip technicolor & ft-3-strip technicolor shader for After Effects


Those two shaders try to mimic Martin Scorsese’s The Aviator movie effects. The codes are based on snippet found on VFXTalk.com, Blender source code & Aviator VFX behind the scene website.

UPDATE : Now ft-2-strip technicolor & ft-3-strip technicolor as merged to a one filter called “ft-Technicolor”

Download & Sources

How to install it ?

Just copy the .pbk file into your “Support Files” folder in your AE install directory


Color Grading with Blender 2.5


Yeahh Matt Ebb just commit my patch (SVN r27733) for the “Color Balance” node in Blender 2.5 Compositing node !!! Now it should be much easier to work with.

You can get a version of blender at Graphicall.org (any version above revision 27733)

There is still some precision issue on the color wheels, I guess some day it will be possible to move the color picker slower.

How to use it ?

First I would recommend you to un-check the “color management” setting in Blender 2.5 or it will make the blacks really hard to control.

If you are not so familiar with color grading, and push-pull techniques, I would really recommend you to watch Stu Maschwitz’s (Prolost) video tutorial using Magic Bullet Colorista. The settings won’t be exactly the same, but the approach quite the same though !

Red Giant TV Episode 22: Creating a Summer Blockbuster Film Look from Stu Maschwitz on Vimeo.

How does it works ?

I described the Lift/Gamma/Gain in a previous post, and mostly this node is based on the formulas specified there. We just slightly modified it so the 3 defaults values parameters are equal to 1.0 just like in Colorista. Which makes it much easier to control the blacks.
Actually the “Color Balance” node before this revision was the same formula but with lift default value equal to 0.0

Some presets !

While making some comparison test between Colorista in After Fx and the “color balance” node in blender, I tried to mimic some of Colorista’s presets.
You can download the “Blender Color Grading Presets” here : http://code.google.com/p/ft-projects/downloads/list

There is the following presets :

Bleach preset w/ Color Balance node
Cold preset w/ Color Balance node
Cool to Warm preset w/ Color Balance node
Day to Night preset w/ Color Balance node
Punchy preset w/ Color Balance node

vignetting using Mike Pan's approach

Understanding Gamma and Linear workflow

Even If I’m aware of what gamma and Linear workflow is, I’m not quite sure I’m using it always in the correct way. So I decide to dive into documentations and forums again to refresh my memory about it and at the same time closing a few gap.
Since so many people, even in the industry, still don’t know what it is and how it works, I thought I would make kind of a dairy of what I found on with my research those couple days.


To get started, there is this great example from AEtuts+.com talking about Linear workflow in AE. It is not a the deepest explanation out there, but it will give you a nice overview with simple words and explicit example of what Linear workflow is and why it is so important !

So after that, 5 points you should keep in mind about Gamma (from Gamma 101 on mymentalray.com)

  1. Most displays have a non-linear response to pixel values.
  2. Most graphics software are written for a linear color model, i.e. they make the simple assumption that 255 is twice as bright as 128. But since the monitor is non-linear, this is not true. In fact, for most monitors (with a gamma=2.2), you need to send the pixel value (0.5^(1/2.2))*255=186 if you want 50% of the brightness of 255. The commonly used value of 128 will only produce about (128/255)^2.2 = 22% brightness.
  3. Digital cameras have a (roughly) linear response to light intensity, but since they are intended for display on computer monitors, they embed the non-linearity (gamma) in the image. (True for .jpg, whereas RAW files are just that – RAW, i.e. linear data, that gets non-linear when converted to JPG, for example)
  4. Therefore, if you input .jpg images taken with a camera into a graphics software, you need to compensate for the images gamma. (by inverse gamma. 1/2.2 = 0.455)
  5. And if you display the (linear) data generated from a graphics algorithm, you need to compensate for the display gamma. (add 2.2 gamma to the picture)

A few facts :

When creating a texture in Photoshop, you’ll see its color with 2.2 gamma applied (Because screens are big liar :p). Meaning when you think you got the good “brightness”, you actually made it twice (or more) brighter than what it’s supposed to be in real world.
When for painting, or montage it might not be import, for texture it is really important !!! Because as said above, your renderer/shader/… will assume the picture is linear and will apply math according to that.
So the only solution to bring this picture back to a “linear color space” is to set the gamma to the inverse of what the monitor shows you. As we know on PC, gamma are shown as 2.2 (I think it’s 1.8 on mac OSX). So the gamma value of your texture before saving it should be 0.455 (1/2.2).

Tips : In Photoshop, on top of your layer, add a “Level Adjustment Layer” and set the gamma value (mid-tone) to 0.455

With most today software I don’t think it is necessary to do that any more, but to be honest, this really depends on how the software you are using integrate Linear Workflow. For instance in 3Ds Max you can enable the Gamma correction in the “Gamma and LUT” tab of the preferences panel.

Because renders works in Linear space, your rendering would seems to look darker on your screen. So in case you are saving it to a 8bits type file (as JPG), you should set the output gamma parameter to 2.2. But in case you are saving  it to a floating point file (HDR, RAW, EXR, …), this parameter should remain 1.0. Because all the dynamics of your picture is saved in those raw file, you would apply the Gamma only in post process (compositing).

In the above case with After Effects, by making sure to activate the linear space workflow, it should take care of that for you, so you don’t have to change gamma to anything, just leave it.

Links :

Mental Ray Linear Workflow from chad smashley on Vimeo.

Here some nice read :

Blender Quick Tips : How to create masks in the compositing editor

Since there is no mask in the “Compositing Editor” of Blender yet, I found a simple tricks which could work pretty well especially in case of color grading.

You’ll see nothing really fancy here since the mask can only be square (or pretty close to a square shape though). But if you check out Colorista for instance, the two allowed shapes are ellipse and rectangle.

Blender Quick Tips : How to create masks in the compositing editor from François Tarlier on Vimeo.

Blender 2.5 – Color Management and linear workflow

I’ve been waiting for this since ever ! Blender 2.5 is managing linear workflow (gamma correction, … ).
Matt Ebb just did a great update where the UI (color picker, …) give you feedback of linear color and present the linear workflow.


Here is the comment of the SVN update (revision 25065) :

Changes to Color Management

After testing and feedback, I’ve decided to slightly modify the way color
management works internally. While the previous method worked well for
rendering, was a smaller transition and had some advantages over this
new method, it was a bit more ambiguous, and was making things difficult
for other areas such as compositing.

This implementation now considers all color data (with only a couple of
exceptions such as brush colors) to be stored in linear RGB color space,
rather than sRGB as previously. This brings it in line with Nuke, which also
operates this way, quite successfully. Color swatches, pickers, color ramp
display are now gamma corrected to display gamma so you can see what
you’re doing, but the numbers themselves are considered linear. This
makes understanding blending modes more clear (a 0.5 value on overlay
will not change the result now) as well as making color swatches act more
predictably in the compositor, however bringing over color values from
applications like photoshop or gimp, that operate in a gamma space,
will give identical results.

This commit will convert over existing files saved by earlier 2.5 versions to
work generally the same, though there may be some slight differences with
things like textures. Now that we’re set on changing other areas of shading,
this won’t be too disruptive overall.

Check out the documentation on the wiki here : http://www.blender.org/development/release-logs/blender-250/color-management

RGBto3D Space application made with processing


I wanted to play with Processing the other night. I thought about representing RGB pixels value of a video in a 3D space based on there RGB value, where RGB stand for XYZ.

Mobile Version on Vimeo

00:00 : using “Avatar” Trailer
01:07 : using webcam feed

How, why, cool ?

So really basic programming, but I thought it would looks cool. Actually, what was going to be a cool looking animation  turn out to become a cool visualisation tool !
I found out that by just showing those pixels in a 3d space based on there RGB values you could see several dimensions at once :

  • Red value : X axis
  • Green value : Y axis
  • Blue value : Z axis
  • Luma value : is the vector between the black color (0,0,0)  -> white color (255,255,255). It means that if the point cloud is closer to the white corner, brighter the picture is (… no kidding 🙂 )
  • Saturation value : it is the vector perpendicular to the luma vector. it means if the picture is saturated wider the point cloud would be, and of course more it is desaturated finer the point cloud will be. A black & white picture would only show particles on the luma value.
    This one was the less obvious to me (but I’m not really smart :p)


Saturate picture = wider point cloud
Saturate picture = wider point cloud
Desaturate = finer point cloud
Desaturate = finer point cloud
black&white = point cloud only show as a straight line on the luma vector
black&white = point cloud only show as a straight line on the luma vector
brighter = point cloud closer to the white corner
brighter = point cloud closer to the white corner
Darker = point cloud will be closer to the black corner
Darker = point cloud will be closer to the black corner

Source Files :

You will have to add a quicktime movie (.mov) in the “data” folder called “vid.mov”

Conclusion :

For sure all this sounds pretty obvious, and I’m pretty sure I’ve seen people doing this kind of stuff before, but I’m surprised I haven’t seen it in any “video editing” software before (or maybe I miss it).

I think it could be a really helpful tool to have a quick over look on your picture and just in a snap being able to tell if its too saturate, too red, or too blue, too bright or too dark…

Feel free to leave any comments about that or if you know something similar, just drop a line in the comments. By the way, this is my really first complete project with processing, so I probably did things the wrong way, you are welcome to correct me 🙂

Saturation Shader


This one should be pretty simple, but still all the shaders I have found on the Internet was based on conversion to HSL color space. Which could be actually useful if  you need some color balance control, but if you just want to control the saturation as fast as you can, it’s probably not the right approach.

Anyway here is a small shader which does the trick (Media Player Classic) :