Script to Implement Red-Eye Removal Technique
January 13th, 2003 by Eric Jeschke in
The latest issue of Linux Journal includes an article explaining how you can remove "red-eye" from flash photographs. Martin Guldahl, author of the Channel Mixer plugin, recently sent me a script that implements the technique in the article (see Listing 1). Put the script into your GIMP scripts directory (e.g., ~/.gimp-1.2/scripts/).
To use the script, simply select a few pixels in the red region of one pupil (i.e., draw a small outline with the rectangle selection tool), then run the script (RC/Script-Fu/Selection/Red Eye). Fill in the parameters, which correspond with the ones described above, and click OK. If the result is not satisfactory, click Undo (Ctrl+Z) and retry the script with different values. Repeat with the other pupil. A second script included in the file (Script-Fu/Selection/Red Eye Desaturate) uses the red channel desaturate technique, and thus does not require Channel Mixer if you don't have it installed.
Red-eye reduction may seem to be an involved process at first, but it actually takes only a couple of minutes once you have the hang of it or even less time if you use the script. Best of all, the results are excellent, especially when photos are printed on a high-resolution photo inkjet printer. Throw this technique into your bag of GIMP tricks, and you'll never have to worry about red-eye ruining your candid flash photos again.
Eric Jeschke holds a PhD in computer science from Indiana University and has worked as a software engineer, university professor and freelance consultant.
Special Magazine Offer -- Free Gift with Subscription
Receive a free digital copy of Linux Journal's System Administration Special Edition as well as instant online access to current and past issues. CLICK HERE for offer
Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.
Subscribe now!
The Latest
Newsletter
Tech Tip Videos
- Nov-19-09
- Nov-04-09
Recently Popular
From the Magazine
December 2009, #188
If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.
Delicious
Digg
StumbleUpon
Reddit
Facebook








red-eye.scm
On December 10th, 2006 Anonymous (not verified) says:
Superb, just worked. Saved me hours of messing.
Thanks
Nice
On August 16th, 2006 Anonymous (not verified) says:
I had good results when I followed the directions exactly. Many thanks Eric.
Lee
Oops
On August 16th, 2006 Lee (not verified) says:
I meant to thanks the script author Martin Guldahl. Thank you Martin Guldahl.
Lee
I tried to use this script fo
On August 17th, 2005 mar (not verified) says:
I tried to use this script for to remove red-eyes effect from my son's photo. The thing is that he is red-headed and now a bit sun-burned (so red color is all-over his face, not in the red eyes only). So the plugin (as well as the hand-technique) had mixed the colours all over the photo. The only way out I had found was to copy red eyes into new image, work with plugin over that new image and then copy them from new image into old one.
:)
Re: Script to Implement Red-Eye Removal Technique
On March 10th, 2004 Anonymous says:
I use College Linux 2.5 (kernel 2.4.23) (should be 100% compatible with Slackware 9.1) and The Gimp v2.0pre3. When I use that function, I receive the following error messages:
Message 1
*********
WARNING: Plug-In "script-fu"
(/usr/lib/gimp/1.3/plug-ins/script-fu)
called deprecated procedure 'gimp_undo_push_group_start'.
It should call 'gimp_image_undo_group_start' instead!
Message 2
*********
WARNING: Plug-In "script-fu"
(/usr/lib/gimp/1.3/plug-ins/script-fu)
called deprecated procedure 'gimp_undo_push_group_end'.
It should call 'gimp_image_undo_group_end' instead!
I tried to manually correct it but then it stopped work at all, that red eye removal script and returned fatal error.
What can I do?
Re: Script to Implement Red-Eye Removal Technique
On May 1st, 2004 Anonymous says:
any idea how can i implement that using VB.NET ??
:)
Tamir
Red eye correction
On June 27th, 2006 anu (not verified) says:
How to perform red eye correction in vb.net?
Re: Script to Implement Red-Eye Removal Technique
On March 10th, 2004 Anonymous says:
I forgot to say, that it makes its work but reduces all image red color, doesn't matter, do I select region or not. It's not result what I expect. I used that old technique, that I zoom in that area, select it with lasso tool, then I turn green and blue color channel invisible and then I change the saturation of red color only. But then I get almost white eyes :( But playing with saturation I can get almost normal result. But this is workaround solution. Here is one articel - http://www.imaging-resource.com/NEWS/1019682730.html but this recourse is not available and it seems like it's not opensource software and freely redistributable :(
Re: Script to Implement Red-Eye Removal Technique
On December 17th, 2003 Anonymous says:
I'm not sure what I'm doing wrong. I downloaded the sript, placed it in the directory, bring up an image with redeyes, zoom in on the redeyes, select the redeyes with the elliptical tool, and run the script, but I keep getting the following error message:
Script-Fu Error while executing
(script-fu-red-eye 6 34 8 40 10 60 30)
ERROR: Procedural database execution failed:
(gimp_image_set_component_active 6 0 0)
I am a newbie to Gimp - I'm running Gimp 1.3.18 on a Suse Linux box.
Thanks,
Re: Script to Implement Red-Eye Removal Technique
On December 18th, 2003 Anonymous says:
I've got good news and bad news. The good news is that this plugin was recently ported to the gimp source tree - and I assume that it will be in the next development release. The bad news is that there is no such release yet, so for now, you have to use gimp-1.2 and download the plugin separately.
Re: Script to Implement Red-Eye Removal Technique
On July 13th, 2003 Anonymous says:
has anyone tried this under windows? i have the latest windows version of gimp, and i downloaded the plugin pack for windows gimp (channel mixer seems to work fine). whenever i run this script, i get the error msg "too few arguments". anyone have any ideas?
thanks in advance!
Re: Script to Implement Red-Eye Removal Technique
On July 17th, 2003 Anonymous says:
This is due to the version of color channel-mixer plugin you have which is older then the one you need. however i did not find yet a compiled color channel-mixer from the newer version.
rani
Re: Script to Implement Red-Eye Removal Technique
On January 15th, 2003 Anonymous says:
Will this script work with Gimp 1.3.x such as 1.3.11?
Re: Script to Implement Red-Eye Removal Technique
On January 14th, 2003 Anonymous says:
There is a slight typo in the script linked by the article.
The symptom is that the first menu command fails to register.
Near the end of the script where it registers both scripts, chage the first one:
(script-fu-register "script-fu-red-eye"
_"<mage>/Script-Fu/Selection/Red Eye..."
to
(script-fu-register "script-fu-red-eye"
_"<Image>/Script-Fu/Selection/Red Eye..."
ie change the "<mage>" to "<Image>"
it all works after that
Re: Script to Implement Red-Eye Removal Technique
On January 14th, 2003 Anonymous says:
Will this technique work for other colors? I took a picture of my cat and it gave him glowing green eyes.
Re: Script to Implement Red-Eye Removal Technique
On January 14th, 2003 Anonymous says:
Cat's have a reflective material in the back of their eyes, helps them see at night. Can't remember what it's called. Anyhow, couldn't you just run the same process on the Green channel?
Re: Script to Implement Red-Eye Removal Technique
On January 17th, 2003 Anonymous says:
The name is tapetum lucidum.
Owned?
On January 14th, 2003 Anonymous says:
Is the download site for the script supposed to be "owned"?
Re: Owned?
On January 14th, 2003 Anonymous says:
it seems so... :-/
Post new comment