How to Auto Crop a Picture with Transparent Background at Runtime?

Is there a way to automatically crop image with a transparent background at runtime? The image will be loaded from the storage and it will be converted as a sprite. Below is my desired output. For further explanation, the input image contains extra spaces and I want it to be the same as the output image that removes those extra spaces. The input image will be dynamic so the cropping position is not fixed which means that the object in the image won’t be exactly at the center. This is my first question so I apologize for some errors of my post.



@aegis911 Did you find out how to do it?