Skip to content

Instantly share code, notes, and snippets.

View Spaxe's full-sized avatar
🏹

Xavier Ho Spaxe

🏹
View GitHub Profile
Take original image A, blur it to get image B. Then:
(A-B) * effectStrength + A
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.