Controlling Chromatic Aberration in your Renders

Well, almost everyone knows about chromatic aberration. It’s that blue and red color fringe that you can apply to the corners of your images to add that extra touch of realism (in some cases; it’s often overused, though I won’t be discussing that in this brief tutorial).

The problem is, sometimes, or more often, all the time, when you add chromatic aberration, it affects your whole image. Take this image for example:


I’ve added a slight amount of chromatic aberration to this render (more than I would usually add, I will note; I generally don’t add this much, as I use it as sparingly as possible). It looks pretty cool in some areas, most notably the earth and the aardvark to the far right.

However, there are a few downsides as well. Take a good look at the top of the spacecraft; it’s blurred. Not significantly, but enough to be relatively annoying. You want the image to look sharp after all, don’t you? Wouldn’t it be great to find a way to control this chromatic aberration so it only effected the corners of the image like it should, and not blur the whole image? Thankfully, there is.

We can mask it out using what is, essentially, a vignette.

  • Start by going into the compositor, adding a new lens distortion node (you can’t use the same node you’re using for the chromatic aberration), and setting the “Distort” value to 1.

  • Next, add a math node (Add, Converter, Math); connect the lens distortion node to the first input on the new math node. Set the second value to 0, and change the type to “Greater Than” (if you’re using an image as an input instead of a render layer, it might not work properly. I’ve found that using a blank render layer for the mask instead remedies this problem.)

  • After that, add a blur node, connecting the math node to this new blur node. Change the type to “Fast Gaussian”, and adjust the x and y values to your taste (I’ll be using 50 for both in this case).

  • Finally, add a mix node. Mix together the lens distortion node (the one with chromatic aberration, not the one for the mask), and the initial render/image. Use the output of the Fast Gaussian blur node and insert it into the “Factor” or “Fac” input on the mix node.

Your node setup should look something like this:


And the chromatic aberration should now be limited to a more defined boundary. If you find that it still sinks too far into your image, lessening the “Distort” value on your lens distortion node may help with this.

I hope this little tip was useful!