TImage32.CropTransparentPixels

procedure CropTransparentPixels;


Trim transparent edges until each edge contains at least one opaque or semi-opaque pixel.


uses Image32, Image32_PNG;
...
img := TImage32.Create;
img.LoadFromFile('star.png');
img.CropTransparentPixels;
//HatchBackground
img.SaveToFile('star_cropped.png');
img.Free;
      
Before:
After: