Skip to content

Instantly share code, notes, and snippets.

@interealtime
Created August 18, 2014 14:54
Show Gist options
  • Save interealtime/b97ced10eb7c74c0a66f to your computer and use it in GitHub Desktop.
Save interealtime/b97ced10eb7c74c0a66f to your computer and use it in GitHub Desktop.
Local contrast filter
Take original image A, blur it to get image B. Then:
(A-B) * effectStrength + B
gives you output with lots more apparent detail.
It boosts contrast against surrounding pixels. A blur kernel with 1 pixel radius is equivalent to standard pixel sharpening, bigger blurs give a better effect but produce haloes around objects. You need a smarter blur that preserves edges to remove them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment