Skip to content

rnbguy/purple-fringe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unpurple

Unpurple is a tool for removing purple fringes (axial chromatic aberration) from digital photos using a heuristic of my own.

Currently there is an OCaml implementation which produces a standalone executable with a simple command-line interface. It is fast enough (~ one second per megapixel) but doesn't preserve Exif data and the JPEG compression factor is fixed at 75%.

I gave up on the gimp integration, but if it's up for grabs if anyone is interested.

Example

Before:

Before

After:

After

Difference:

Difference

More examples

Algorithm outline

  1. Produce a blurred mask from the blue component in the original image.
  2. Subtract from the original image some amount of blue and red based on the intensities found in the blurred mask, using the following constraints:
    • Blue level may not drop below green level.
    • Red level may not drop below green level.
    • Red:blue ratio may not drop below some constant.

Please refer to the implementation for details and default parameters.

About

Removal of purple fringing from digital photos

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • OCaml 68.5%
  • Python 28.2%
  • Makefile 3.3%