question: public static WorldIconImage fromPixelTransparency ( BufferedImage image ) { int imageMarginTop = findFirstSolidPixelFromTop ( image ) ; int imageMarginBottom = findFirstSolidPixelFromBottom ( image ) ; int frameHeight = Math . max ( 0 , image . getHeight ( ) - imageMarginTop - imageMarginBottom ) ; return new WorldIconImage ( image , 0 , imageMarginTop , image . getWidth ( ) , frameHeight ) ; }
target:  Use pixel transparency along the left edge of the icon to automatically determine the vertical frame position. Assumes the image has no horizontal out of frame effects. If you want transparency on the left side of the image without adjusting its frame, or if you want to control where the frame starts, use a pixel that is mostly transparent. (Spawn.png and Witch.png do this)