Is there a way to read the color of a specific pixel from a image-file (.jpg)?

I'd like to use this to trim pictures from there black background.

Thanks!