Archived topic
Add border to images if primary color is white
1 reply · Started by Max on December 14, 2022
Is it possible to add a border to all images in single posts, but only if the primary color of that image is white?
I have some articles with screenshots of web applications that have white backgrounds, and I would like to add a border to those. Without having to add a global style or css class every time. Would be nice if it happens automatically.
See example: https://jmp.sh/bcNCue2R
Ideally it would somehow analyze the image, and add a class to all images that have a (nearly) white background.
Thanks!
Hi there,
the simple answer is no.
I dare say it is possible as there are plugins and server side library's that could get the dominant color and analyse its luminosity. And then filter in a class to the attachments HTML if a certain threshold is passed. But that would require custom development.