jimp
jimp copied to clipboard
Detect Brightness / Bright Image
I'm trying to create a smart invert feature where given an image, if that image is bright it will invert it to make it dark and if its already dark leave it alone.
Is there a way to read the current brightness of an image overall?
The images im trying to invert are typically on a off white background or a dark grey background. So differentiating them should be striaght forward.
Thanks in advance for any help.
Hope, this can help you ) https://stackoverflow.com/questions/38211798/detect-if-image-is-dark-light-and-addclass-dark-light-to-parent