Detect Pixels of Background image is Transparent

Does anyone know a library that can detect if a background is transparent for an image?

We are using a background removal service but the results do not work correctly if the background is already transparent so want to test this in the code to not allow it.

My thoughts would be if you can load the image and lets say detect the image pixel #1 from the top left corner to see if it is transparent or #FFFFFF or black for example.

Has anyone had experience in this or know of anything out there using JS or SHARP?

I’m sure computer vision with Python / heavy CPU related package would work but trying to keep this lighter if possible.

Community Page
Last updated: