(An αξ product.)

News (2004)

Refract re-re-surfaces; some folks have been asking if this plug-in runs under GIMP 2.x. Now it does. In the process, I've moved parts of it in to Python, out of the belief that will make it easier to maintain.

In short:

Uses a grayscale image for a height field as a lens of specified refraction index to distort an image.


The Code:

The source is released on SourceForge. I'm using a local subversion repository for version control for the time being.

The Longer Story:

Inspired by a request for a "sneeze" plug-in to mimic water drops on the screen... Sure, you can get pretty good effects with displace and bump map and what have you, but for an alpha xi AP Physics student like myself, that just ain't good enough.

Note: You'll need to write your own plug-in that actually calculates what the height field for a sneeze-lens looks like... Density of the droplets affected by distance and the "spray" factor, their height and shape determined by their cohesion and adhesion to the screen, how fast they hit the screen, and if any droplet is such a critical mass that it will begin sliding down the screen, possibly leaving a slight trail behind...

You should probably also add a checkbox asking the user if they've brushed their teeth since they last ate, in case small particles of food need to be factored in to the cohesion-equation and added as a seperate partially opaque layer...


This will only reflect/refract once per surface... So even if you make a really bizzare shaped lens, don't expect me to know or care that the ray left and re-entered the lens or anything odd like that... At that point, you need to go and get yourself a raytracer like POV-Ray.

This lens has a flat side right up against your image, like the spittle on your screen. Two-sided lenses could be on the TO DO list, but that could get messy...

We're assuming we're far enough away from the lens that the only rays we see from the lens are, for all practical intents and purposes, parallel to each other and perpendicular to the image.

At the moment...

Not everything planned works, but everything that the average user can see appears to be working relatively smoothly. I hereby deem refract to have progressed to "beta" stage. Three cheers for refract!


Update for GIMP 2.0, including:
Update for GIMP 1.1, including:
#warnings are gone, Refract moves from Distorts to Glass Effects.


necessary luxuries:
excessive luxuries
for version 1.1
for version 1.2
for version >= 2.0 (fancies)


Many thanks to . . .

Common Indices of Refraction:

(For yellow sodium light, wavelength 589 nm)

Air: 1.0003
Ice: 1.309
Flourite: 1.434
Rock Salt: 1.544
Quartz: 1.544
Zircon: 1.923
Diamond: 2.417
Crown glass: 1.52
Water: 1.333
Ethyl alcohol: 1.36
Turpentine: 1.472
Glycerine: 1.473

Old News (2000)

Refract has re-surfaced. For the past few years, I considered it dead, as I wasn't getting much feedback on it, and Tom Bech and I agreed that if it was going to exist, it would be folded back into his Lighting Effects plug-in, where it was in 0.54. But that never happened, and I heard of a few people who like the plug-in, so I decided it was finally time to bring it back to life for GIMP 1.1.x. The dialog has been entirely rewritten to be more compact, less buggy, and more compliant with new plug-in features and standards (i.e. no more megawidgets).

[ GIMP homepage | Plug-ins at SourceForge | Plug-in registry ]

Last modified: 2004/10/05 06:10:31
Maintained by Kevin Turner <> [OpenPGP Key]