Have you tried a simple one step action.
Setp menu Image>Trim in the trim dialog set based on top left ot bottom right pixel and check top bottom left and right
That should crop your image to your objects bounds...
Doesn't work. I only do this when the backgroung is flat color.
My grey background has smooth variations and it trims the image on all of it, not only the object.
It should be helpful if the trim dialogue could have a fuzziness % to tell what I want to really select.
There are examples of using select color in functions posted here… Have you tried to use that with a fuzzy factor then inverse the selection… thus giving none grey middle shape…
I'll try that... when I'm not so busy.