Red Eye Removal
First of all, I'm a newbie in script-fu. I've written a plug-in for
myself, which implements the approach I've been using manually for some
time:
1. It does not select anything, it assumes the selection of the pupils
has been made before by user.
2. It remembers the selection in a path (just in case).
2. It creates another image with the size of the selection to save
resources.
3. Copies the selection into the new image.
4. Decomposes the new image into RGB channels (new images).
5. Copies the Green channel image and pastes it into the Red channel image.
6. Sets the opacity of the floating selection to 75%.
7. Anchors the floating selection.
8. Copies the Blue channel image and pastes it into Red channel image.
9. Sets the opacity of the floating selection to 25%.
10. Anchors the floating selection.
So, now the former Red channel is 75% of former Green and 25% of former
Blue.
11. Composes a new image from 3 images (former Green, former Blue and
new Red).
12. Copies the new image and pastes it into the selection of the initial
image (with TRUE option).
13. Deletes all the intermediate images.
So, the result is: a floating selection above the initial pupil(s)
selection with corrected pupils. If I like the result, I anchor it.
If somebody is interested I can post these trivial code somewhere.
Sven Neumann wrote:
Hi,
a plug-in or script to do red-eye removal is one of the most prominent
feature requests that are coming up over and over again. I wonder if
anyone has evaluated the existing scripts and would be willing to
either adapt one of them for inclusion with GIMP 2.4 or, alternatively
try a different implementation that we can include with 2.4.
It could be interesting to use the SIOX foreground extraction routine
for this. Based on a rough selection of the eyes, the algorithm could
be useful to select the relevant pixels. Might be worth giving a try.
Not sure if the current PDB API for the SIOX tool is good enough for
this but we can certainly do the necessary improvements if it isn't.
Any volunteers for this?
Sven