Yes, you can imitate it. Physically, this is a very simple effect, and only your eyes make it look like a more complex illusion.
This is just a combination of two layers:
- photo (backlight)
- reflection (no backlight)
Reflection just exists all the time. The backlight image is on or off. In terms of implementation, these are additive levels (the sum of pixel values).
The eyes perceive only the backlight in the full image change mode, since the eyes adjust the overall brightness level of the screen.
If you implement this in code:
make sure that you use a linear color space for processing (delete gamma correction, process pixels, apply gamma correction).
when displaying the image on the screen, normalize the brightness (since to display the effect on the screen you need to be brighter than the real effect of the real world, and you have a lower dynamic range for operation).
source share