I have a series of transparent logos. I paste them on a canvas using PIL. Some of these logos have extra transparent pixels that make the bounding box too wide, like this:
However, I need these logos and the bounding boxes to be like this:
How can I remove these extra, unnecessary transparent pixels so the bounding box wraps the logo properly?
Here are some of the logos:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…