Fake Depth of Field (DOF) in GIMP

Updated: January 22, 2014

If you want to change your flat images to appear as if they have some field of depth, or focus blur, then you might want to read this tutorial. It will teach you, briefly, about the needed plugins for GIMP, which should let you achieve the desirable results.

My interest in DOF spiked while playing with my 3D models, including the Urban Warfare project lately. I wanted to create an illusion of focus blur and mist, and quickly learned that very decent results can be achieved by using the Depth Render option in Kerkythea. But this only applies to 3D models, and not necessarily your images or photos. So let's see how you can remedy through art what was made wanting through action in the first place.


GIMP plugin

We will require a certain plugin for this - the Focus Blur plugin. Now, how you can install and compile this plugin, well you shall learn in a separate tutorial very soon. At the time being, we will assume that you have working binaries in place, both Linux and Windows, and then we will explore some of the options.

You can find the plugin under Filters > Blur > Focus Blur. However, this is not the only option available, and depending on you have configured the plugin, or built it, you might have additional features, like Toy. More about that in a jiffy. Really.

Focus blur, launch

Now, it's time to play with different options and learn how you can use the filter to your benefit. You can also use a Depth map, but in this case, you might want a simple black & white gradient picture, much like the one generated in the Depth Render in Kerkythea. Might not always be possible, but it could work.

Fblur, main view

But an even more interesting component is Toy. This one lets you create vertical and horizontal limits for your depth of field. You can vary them as you see fit, and change the amount of focus and distance. Best thing is to work with several layers, so you don't blur objects in the foreground too much.

Toy filter


Here's the tricky part. Finding a compiled binary of this plugin for Windows is rather difficult. There are several builds lying around the Web, created by enthusiastic users. However, they might be outdated, partial in their functionality, unsuitable for your version of GIMP, and coming from third-party sources that you might not necessarily trust. Moreover, I have managed to find plugin versions from as far back as 2006, and they are notably different from more recent ones, in terms of their functionality. You can use any which one you want, of course, or both, but your results may vary, especially compared to the experience Linux users have.

The following articles may help you locate the desired plugin; remember, this is third-party unofficial content, so please exercise the necessary discretion, common sense and whatnot.

GIMP Fblur plugin

Plug-ins for The GIMP

Focus Blur for Windows

And you can also find some builds in the GIMP registry article further above.

Now, as you will see, the results differ on the version you choose. The older plugin from 2006 has the option to use the Distance Mask and then vary the blurring based on white and black, although this may not give the desired quality in the output. The newer version behaves like the Linux plugin, but it does not have the Toy option.

Old Fblur working

Old Fblur distance option

Other resources

There articles might also be of use:

Fake Depth of Field in GIMP - FOD Explained

My tutorial on GIMP plugins

Reykjavik Tilt Shift

And now the conclusion

This is a fairly simple tutorial, but it has a bit of everything. A healthy dose of GIMP, both for Windows and Linux users, how to use GIMP plugins to enhance your digital experience, some theory on DOF, and more besides.

Now, I did promise to teach you how you can install and configure the Focus Blur plugin, and this will indeed happen in the very next art-related article. We will learn about some more on compilation from sources, working around compilation errors, and adding the missing extras in other to successfully build the plugin, all on Linux. Stay tuned.


You may also like: