Transparent Object Script

10/05/2009 14:23:47

Download this plugin.

Background

After version 2.0 of The Gimp was released, I became interested in how to write scripts for it. GIMP scripts are written in scheme, which is the same language that GNUCash uses for its reports. Since I am interested in writing reports for that as well, I figured it was time to take a look at scheme.

Ron Scott has an interesting tutorial on creating transparent objects that I liked, so I figured I would script it.

It wasn’t too hard to learn some of the basics of the scheme language, and scripting the GIMP is wonderfully easy.

In any event, the plugin is available at the bottom of this page. To use the plugin, place it in your scripts folder and select an interesting object to convert. Once it’s finished, the selection is pre-set to allow you to adjust the curve for the alpha channel so that you can make the object more transparent. The script is fairly true to Ron Scott’s original tutorial, but makes it a little more flexible, and uses an alpha-channel drop shadow that is more flexible than the technique used in the original.

Feedback is welcome!!

Example images

Original Object Mask

Transparent Object Mask
Transparent Object Mask

Final Rendered Image

Transparent Object Rendered
Transparent Object Rendered

Version 0.2

I updated the script to version 0.2. The improvements are:

  • More closely follows the color used for the edge highlighting and shading by inverting the color prior to performing the bumpmap, and then reinverting afterwards. I like the effects better. I also inverted the bumpmap direction, which makes the highlighting more consistent with the default lighting direction. In Ron Scott’s version, the highlighted edges should have been in shadow, and vice versa.

  • Display a message prompting the user to adjust the alpha layer for a transparency effect.

Known issues:

  • If the selected layer is not on top, the newly created drop-shadow layer will be above the object. Clearly not right. ;)