https://alexonraw.com/optimizing-the-contrast-with-levels/book_1_6_1/