how to fit a body to a sprite avoiding transparent space?

i´ve been looking arround and i can´t get a way to do that in code, a way would be to modify the .png files before loading them on the memory, but i supose it has to be some way to detect the transparent space wich is arround and modify the sprite to fit his size :-\