Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A simpler way of achieving the same thing is to duplicate the layer, blur the top layer heavily, and then set it to "divide".


interesting trick, thanks for sharing ! [edit] Quick test here : https://imgur.com/a/6xOz1


I think that test illustrates it'll take quite a lot more to achieve what the tool in the article did...


Really? Do you care to explain? What is the dividend and what is the divisor? Why can dividing a image by its low pass filtered version (or vice versa) be used to "clean up" the image, i.e. subtract the background, find main colors and cluster similar colors with k-means? What if the divisor has pixels near zero?


Areas of low contrast become whiter and areas of high contrast become more saturated.

It is also more robust than k-means. The author's algo will only work on scanned images. Photographed pages from a book will often have a slight shadow on half the page from the curvature. Blur-divide will clean this up. K-means will think you've used a lot of gray and not figure out that there are multiple background colors.


I can confirm that the author's approach doesn't work well for photographed pages. I took a photograph[0] of a page of notes, and due to the shadow, the results[1] were very unsatisfactory.

[0]: https://i.imgur.com/CLZHshT.jpg

[1]: https://i.imgur.com/rrwca0m.jpg




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: