After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 91795 - Easy red eye removal tool
Easy red eye removal tool
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
1.x
Other All
: Normal enhancement
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2002-08-27 15:08 UTC by Brendan Arnold
Modified: 2006-04-24 10:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Examples of tool applied to non-redeye areas for analysis (115.06 KB, image/jpeg)
2003-08-30 19:26 UTC, Brendan Arnold
  Details
Example of adjustable selection tool and the result (110.18 KB, image/jpeg)
2003-08-30 19:28 UTC, Brendan Arnold
  Details
Patch for red eye removal against current GIMP CVS (15.20 KB, patch)
2006-04-23 11:21 UTC, Andreas Røsdal
committed Details | Review
Demonstration of using the red eye removal plug-in (67.96 KB, image/png)
2006-04-23 11:22 UTC, Andreas Røsdal
  Details

Description Brendan Arnold 2002-08-27 15:08:47 UTC
Recently changing from JASC Paintshop Pro 7.04 in Windows, I miss the
red-eye removal tool. Although  know it is possible to do manually, but I
have hundreds of photos and manually removing the red-eye on each one would
take an age. The Paintshop Pro tool took seconds to use and has a more than
adequate output for casual photographers. In case you are unfamiliar with
the Painshop Pro tool I have described some of its main features below.

It brought up a seperate window whhich allowed editing before changing the
photo. It recognised the face area and zoomed into it automatically. You
dragged a circular sleection over the red-eye area and it would recognise
the rough shape of the eye and draw in over the red-eye. This could be
adjusted by incresing the size of the selection and dragging the selection
around. Different colours and shades of eye were possible as well as
different iris sizes. Options for red-eye removal for animals (presumably
looking for green rather than red,) and manual selection with a freehand
tool were all possible. Other (lesser used,) options included, feather,
blur, glint lightness, glint size, pupil brightness, centre glint and refine.

Results were shown in a preview window before you accepted the changes.

Perhaps this could be included as a plugin for the GIMP. I'm sure that it
would win much more acceptance from ameteur photographers, especially with
the recent popularity of digital photography.
Comment 1 Alan Horkan 2003-07-22 21:20:42 UTC
A script was written to make this easier after the various long
methods were described in an article in Linux Journal.  

I will try and find the script but a easy user friendly plugin with an
interactive Dialog like Paint Shop Pro or other tools would definately
be really useful.  

A screenshot of this feature might be helpful to a developer
interested in adding this feature, if you could attach a screenshot to
this bug report it would be helpful, if you cant I will try and do it
myself at a later date.  
Comment 2 Alan Horkan 2003-07-23 18:38:46 UTC
Changes at the request of Dave Neary on the developer mailing list.  
I am changing many of the bugzilla reports that have not specified a target
milestone to Future milestone.  Hope that is acceptable.  
Comment 3 Maurits Rijk 2003-07-24 09:29:35 UTC
This looks to me like a useful plug-in for future inclusion. Of course
someone still have to write it :) In the meantime we could maybe
distribute the script that was mentioned.
Comment 4 Brendan Arnold 2003-07-28 15:25:11 UTC
I don't have access to Paintshop right now. I'll be able to post 
screenshots after the 10th of August.
Comment 5 Alan Horkan 2003-07-28 20:46:42 UTC
I have taken several screenshots of PaintShop Pro 8 but I am quite 
dissapointed by thier Red-eye 'removal' tool.  I hope to provide a 
write-up soon.  I'll post to the developer mailing list and here too 
if I remember.  

I hope to look at other Red-Eye tools.  

The most important thing we can do is to find and make sure we can get 
GPL/LGPL/or better rights to use the Script that was written and 
posted at LinuxJournal.com in response to a Linux Journal article 
several months ago.   
Comment 6 Alan Horkan 2003-07-28 21:04:33 UTC
http://linuxjournal.com/article.php?sid=6567

Script included in the article, I expect it can be improved and 
hopefully licensing can be sorted out quickly.  

I'll try and contact the author tomorrow.  
Comment 7 Brendan Arnold 2003-08-30 19:26:27 UTC
Created attachment 19616 [details]
Examples of tool applied to non-redeye areas for analysis
Comment 8 Brendan Arnold 2003-08-30 19:28:45 UTC
Created attachment 19617 [details]
Example of adjustable selection tool and the result
Comment 9 Alan Horkan 2003-08-30 19:32:13 UTC
I contacted Eric Jeschke author of the article instead of Martin
Guldahl <mguldahl@xmission.com> who is author of the script.  

Will try again.  
Comment 10 Brendan Arnold 2003-08-30 19:38:04 UTC
Attached are some screenshots from Paintshop Pro 7.04.

The one with examples applied to non-redeye areas will hopfully give
you a idea of what sort of algorythm is used.

The right hand window is used to navigate around the larger picture
with a drag tool. The left window is used for creating selections and
showing previews of the final image before accepting changes.
Comment 11 Martin Guldahl 2003-10-18 20:28:42 UTC
I've been tinkering with that red-eye script.   
 
In the previous version, it registered two functions - one that removed red-eye using 
Desaturate, and one that removed red-eye using a plug-in I wrote: the <a 
href="http://registry.gimp.org/plugin?id=1918">Channel Mixer< /a>. 
 
In the latest version <a 
href="http://www.xmission.com/~mguldahl/projects.html/red-eye.scm">red-sys.scm</A>, 
I combined the two functions into one with a "Method" to select how one wants remove 
red-eye.   Give it a try. 
 
I tested it in 1.2 and it works ok, but the Channel Mixer does not (yet) compile in 1.3. 
 
Comment 12 Sven Neumann 2003-10-18 20:42:57 UTC
There was interested to include the plug-in in GIMP proper. It
shouldn't be hard to port a plug-in to the new API. Any particular
problems you have that we could help you with?
Comment 13 Manish Singh 2003-10-18 21:09:44 UTC
Looks trivially portable to 1.3, but could stand some general code
cleanup.
Comment 14 Maurits Rijk 2004-01-26 08:13:20 UTC
I just found an interesting article on automatic red eye removal:

http://www.crl.hpl.hp.com/who/people/ulichney/bib/papers/2002-redeye%20-%20ICIP.pdf

Basically they first use an algorithm from Viola and Jones (lots of
info about that on the Internet) to recognize a face in a picture.
Within the bounding box of that face they then look for redness and
compensate for that. Real neat. Step 1 (looking for the face) is the
hardest, but I think there's actually an Open Source project on
sourceforge that has code for this. Will add link as soon as I've
found it.
Comment 15 Maurits Rijk 2004-01-26 10:16:42 UTC
Project with code for recognizing faces in an image:

http://sourceforge.net/projects/kolmogorov

Code is in C++, but shouldn't be too difficult to translate to C. This
would make a very nice graduate project. Hopefully I will have some
time to experiment with this myself.
Comment 16 tobias 2004-04-22 10:41:49 UTC
Lindows/Linspires lphoto has a red eye removal tool. It's written in python and
the code is GPL.

The Homepage:
http://www.linspire.com/lphoto
 
The Code:
http://software.lindows.com/emptypool//lindowsos/pool/main/l/lphoto/lphoto_0.11-0.0.0.45.lindows0.1.tar.gz
Comment 17 Alexey Eremenko 2004-05-16 00:26:34 UTC
I really would like to see this feature implemented.

-Fenix*NBK* (fenix@theopencd.net)
Comment 18 Arcady Genkin 2005-03-15 05:45:29 UTC
The KDE photo editor digikam http://digikam.sourceforge.net/ (I'm using version
0.7) has red-eye reduction which works fairly well (open an image, select a
region, then it's the menu item Fix->Red Eye Reduction).  This is a GPL-ed
program, so perhaps the algorithm that it employes can be a starting point for
Gimp's red eye reduction feature.

I think that Gimp will benefit big time from this functionality.
Comment 19 Sven Neumann 2005-03-15 20:33:58 UTC
That functionality is available for GIMP for quite a while already. See for
example http://gimpguru.org/download/red-eye.scm and
http://fmg-www.cs.ucla.edu/geoff/digicam/redeye
Comment 20 Sven Neumann 2005-07-26 14:56:44 UTC
I hope that we can use the new SIOX foreground extraction algorithm to implement
a reasonable semi-automatic red-eye removal tool. But first, let's implement the
SIOX tool, then look at red eyes again...
Comment 21 Andreas Røsdal 2006-04-23 11:19:58 UTC
Here is an updated plug-in for red eye removal. It is based on the redeye plug-in by Robert Merkel, found at http://registry.gimp.org/plugin?id=4212 It is a patch against the current GIMP CVS, updated with documentation, i18n, preview etc. to be as usable as other GIMP plug-ins.

The plug-in uses thresholding to detect red pixels, and removes the red color component. To use the plug-in, simply select a region surrounding the eyes, apply the filter and adjust the threshold until the red eyes are removed. I have tested it on a wide range of red colored eyes found though a google search, an example is attached. The results will be better if you make a selection around the eyes, to prevents other red regions in the image to be detected. I believe that automatic removal of red eyes is impossible.

This plug-in doesn't use the SIOX tool to automatically detect the red eyes. I have experimented with detecting the red component using the SIOX tool manually, and so far the tool has not been able to accurately segment out the red regions only, usually there are red pixels in the border of the selection-result from the SIOX tool. 


Comment 22 Andreas Røsdal 2006-04-23 11:21:08 UTC
Created attachment 64136 [details] [review]
Patch for red eye removal against current GIMP CVS
Comment 23 Andreas Røsdal 2006-04-23 11:22:00 UTC
Created attachment 64137 [details]
Demonstration of using the red eye removal plug-in
Comment 24 Sven Neumann 2006-04-23 11:50:52 UTC
Thanks a lot for your work. I will look at the attached code as soon as possible and add it to the CVS tree if I find it to be suitable. Setting milestone to 2.4.
Comment 25 Sven Neumann 2006-04-23 12:16:25 UTC
Added to CVS after some minor changes:

2006-04-23  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/Makefile.am
	* plug-ins/common/plugin-defs.pl
	* plug-ins/common/redeye.c: added Redeye Removal plug-in, written
	by Robert Merkel and Andreas Røsdal. Fixes bug #91795.

Closing as FIXED. But someone should look at making the plug-in use the new GimpZoomPreview widget.
Comment 26 Sven Neumann 2006-04-24 10:04:48 UTC
2006-04-24  DindinX  <dindinx@gimp.org>

        * plug-ins/common/redeye.c: use a zoom preview instead of a drawable
        one.