This may sound confusing but I will demonstrate what my goal is. I want to crop the extra space around a image using python. You can see in image two the outside border is cropped off until it cuts out the extra space around the colored bars in the center. I am not sure if this is possible. Sorry for the vague question as it is very hard to explain what I am trying to do.
(Before) Image Before Cropping ----------> (After) What I am trying to achieve. You can notice the extra black space around the colored thing in the center is cutout on the after image.
I want to be able to cut the extra space out without me manually typing in where to crop out. How could this be done?