the solution I have here hinges on having a good alpha mask. In my example I also make use of the Banana and while it already comes with a good alpha channel, I added a threshold so this might work well with other custom imagery.
The basic Idea is that the Analyze TOP can retrieve the minimum or maximum individual pixel in an image. So if we can give every pixel in our image a position, we can retrieve the minimum and maximum position which results in our bounding box.
To ascribe position to a image, we multiply the image (already with the alpha channel) with a so called uv map - essentially a texture that is a vertical ramp in the red channel and a horizontal ramp in the green channel. Add 2 Analyze TOPs setting them to Minimum Pixel and Maximum Pixel respectively as well as setting the Analyze Channel parameter to “RGBA Independent” and the Mask paremter to “Alpha”. The 2 resulting images I combine with a Layout TOP and convert into a CHOP which finally holds the values I can use in the Crop TOP.