I suggest you to look at this interesting jQuery plugin called BackgroundCheck:
http://www.kennethcachia.com/background-check/
This plugin automatically switch to a darker or a lighter version of an element depending on the brightness of images behind it.
Download the minimized version from Github: https://raw.githubusercontent.com/kennethcachia/Background-Check/master/background-check.min.js
How to use:
If an element overlaps any of the images, either .background--dark or .background--light is added to it. BackgroundCheck does not change an element's style — you must do so using CSS.
p.background--light {
color: black;
}
For more detailed information, check the documentation here:
https://github.com/kennethcachia/Background-Check