darktable-org/darktable — pull request #326 by bluesceada (2013-10-16 13:29:55+00:00)
Title: Defringe

Please try on your pictures! It could probably be improved in many ways. It is also too slow for my taste.

This is meant to remove "fringing" (often purple colored fringing) that comes from longitudinal CA - from my understanding an effect that doesnt come from geometrical characteristics (like classic CA that distributes stronger from the center), but just happens at strong contrast edges that are not directly on the focal plane, but just close to it.

However, this doesn't meant it also works for "classic CA" - but that would just be best corrected with a lens profile.

Thanks for any input what could be changed in the code to make it more robust/just work better overall, etc.

One issue for me is that when working on too many pixels (low threshold), the computation overhead will really be high, but if not enough pixels are touched, there are sometimes artifacts still there at the fringes, or not everything gets removed.

There are many options that are still not fully evaluated and can be improved:
1. Maybe use something else than the fibonacci lattice in a radius, maybe pre-compute it to speed things up
2. Evaluate what else could be done when we have user input about the fringe colors
3. Evaluate entirely different ways to remove fringe. I have found one that only needs blur and otherwise works on single pixels, but it seems to be only intended to remove purple (with a certain red/blue amount) fringe, not all types - but maybe that can also be implemented. Here it is: http://www.gimpusers.com/forums/gimp-developer/14646-purple-fringing-removal-extension (The code is in OCaml which needs some time to get used to...)

Ok then, thanks for any comments!