Function Image.getUsedRect

Returns a Rect2 enclosing the visible portion of the image, considering each pixel with a non-zero alpha channel as visible.

Rect2 getUsedRect() nothrow @nogc const;