lua.wetgenes.grd.shrink
g:shrink(area)
area is an {x=0,y=0,z=0,w=100,h=100,d=100} style table specifying a 3D area, set {z=0,d=1} for a 2D area.
You should set this to the full size of the image.
This function looks at the pixels in that area and shrinks each edge inwards if it is fully transparent then return this new area in the same table that was passed in.
You can then use this information to crop this image resulting in a smaller sized grd containing all the solid pixels.