Is it possible with PHP (alternatively JS or something similiar) to detect if an image has a mostly white background?
It is because where I display my images there's a white background. And some images have a dark or colorful background, but some are white or mostly white. And I have a css class called img-shadow
that adds a shadow to an image. So I would like to add that only if the background of an image is white or mostly white.
Here's an example to show you what I mean:
Even there are a lot of pitfalls in whole process, I would choose doing it using PHP.
Firstly, answer yourself following:
You have to:
On top of that I suggest:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With