Toy plug-in for GIMP simplifies creating tilt-shift fakes

Toy plug-in for GIMP simplifies creating tilt-shift fakes

Rüdiger Schneider released the first public version of his GIMP-plug-in called Toy that does a very simple thing: it simplifies creating the so called tilt-shift fakes.

The trick itself is very simple: using the Blend tool and its bilinear method create a layer mask in a copy of a source layer so that most of an image can be affected but a rectangular area. Applying blur to that upper layer will create an heavy out of focus effect that with additional color grading will make objects in the image (houses, cars, people) look like toys. Originally this is done with tilt-shift lenses that make shallow depth of field.

What the plug-in does is providing simple controls with a large preview area: by dragging the green handle in the preview you can tell the plug-in where completely in-focus area is (it will be perpendicular to the line in the preview, invisibly intersecting it across the green handle), and by dragging the red handle you can define where the picture goes completely out of focus.

The plug-in will read that, create a copy of the layer, generate a mask in it and use positions of the handle to render a bilinear gradient. It will also read and apply amount of blur, contrast and saturation that you set in the plug-in. Here is a video we shot to illustrate that, using a picture of Prague rooftops by tjflex:

This first version of the plug-in makes use of Gaussian blur, which is why the effect is not as believable as it would be if the great Focus Blur plug-in by Kyoichiro Suda was used. That might change in the future. As a side note, it would also be great if the invisible in-focus marker line was a wee bit less invisible. The yellow cross in the video was composited into the screencast.

The plug-in will compile and work just fine with GIMP 2.6. If you run in in 2.7, it will start spitting out warnings about API changes. Edit: following the discussion Rüdiger promptly released an update that makes the plug-in work fine in both 2.6 and 2.7/2.8. Yay!

Currently there are no builds for Windows, but watch that page for updates if you are interested.

For a more sophisticated approach I very much recommend Rob Antonishen's tutorial on the subject.

Was it useful? There's more:

15 Responses. Comments closed for this entry.

  1. Cool plugin and great video editing to present it, many thanks to RĂ¼diger Schneider.

  2. I tried to compile it under Ubuntu 11.10 64bit, I have Gimp 2.6 and I get this error :
    checking for GIMP… no
    configure: error: Package requirements (gimp-2.0 >= 2.2.0 gimpui-2.0 >= 2.2.0) were not met:

    No package ‘gimp-2.0’ found
    No package ‘gimpui-2.0’ found

    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.

    Alternatively, you may set the environment variables GIMP_CFLAGS
    and GIMP_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.

    What can I do?

  3. Try ‘sudo apt-get build-dep gimp’ to install all packages required to be able to build extensions for GIMP.

  4. I compiled this for Gimp-2.7.4.
    It works well in both portable and regular installed Gimp.
    You can get the plugin here


  5. Hi there!

    Just to be more complete.

    I’ve been using the focus-blur plugin for
    Gimp. This plugin uses a pre defined mask
    for objects which have to be in focus.


  6. Do You planing upgrade this amazing plugin for Gimp 2.8

  7. Alexandre Prokoudine 19 February 2013 at 7:27 pm

    @ciap, doesn’t v1.0.4 already work with GIMP 2.8?

  8. I tried several hours and…. make install done with success. So, 1.0.4 perfectly work with Gimp 2.8 :)

  9. Alexandre Prokoudine 20 February 2013 at 6:01 am

    Great :)

  10. Can you update the plugin to work with newer versions of Mint/Ubuntu?

    make[2]: Entering directory `/home/chris/Downloads/gimp-plugin-toy-1.0.4/src’
    gcc -g -O2 -Wall   -o gimp-plugin-toy interface.o main.o render.o -lgimpui-2.0 -lgimpwidgets-2.0 -lgimpmodule-2.0 -lgimp-2.0 -lgimpmath-2.0 -lgimpconfig-2.0 -lgimpcolor-2.0 -lgimpbase-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0  
    /usr/bin/ld: interface.o: undefined reference to symbol ‘floor@@GLIBC_2.2.5’
    /usr/bin/ld: note: ‘floor@@GLIBC_2.2.5’ is defined in DSO /lib/x86_64-linux-gnu/ so try adding it to the linker command line
    /lib/x86_64-linux-gnu/ could not read symbols: Invalid operation
    collect2: error: ld returned 1 exit status
    make[2]: *** [gimp-plugin-toy] Error 1
    make[2]: Leaving directory `/home/chris/Downloads/gimp-plugin-toy-1.0.4/src’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/chris/Downloads/gimp-plugin-toy-1.0.4’
    make: *** [all] Error 2

  11. Nevermind, ./configure LIBS=-lm fixed it.

  12. Cool plugin and great video editing to present it

  13. Thanks for this tip. As an everyday user of Gimp, I’m sure this will come in handy. Thanks again!

  14. Thanks for the tip. Using Gimp, for me it’s nice to discover the presence of plugin like this.