@NotNull public static BufferedImage pad(@NotNull BufferedImage image,int paddingPercent){
  if (image.getWidth() <= 1 || image.getHeight() <= 1) {
    return image;
  }
  if (paddingPercent > 100) {
    paddingPercent=100;
  }
  int largerSide=Math.max(image.getWidth(),image.getHeight());
  int smallerSide=Math.min(image.getWidth(),image.getHeight());
  int padding=(largerSide * paddingPercent / 100);
  padding=Math.max(-(smallerSide / 2 - 1),padding);
  return AssetUtil.paddedImage(image,padding);
}

@ NotNull public static BufferedImage pad ( @ NotNull BufferedImage image , int paddingPercent ) { if ( image . getWidth ( ) <= 1 || image . getHeight ( ) <= 1 ) { return image ; } if ( paddingPercent > 100 ) { paddingPercent = 100 ; } int largerSide = Math . max ( image . getWidth ( ) , image . getHeight ( ) ) ; int smallerSide = Math . min ( image . getWidth ( ) , image . getHeight ( ) ) ; int padding = ( largerSide * paddingPercent / 100 ) ; padding = Math . max ( - ( smallerSide / 2 - 1 ) , padding ) ; return AssetUtil . paddedImage ( image , padding ) ; }
pad the image with extra space . the padding percent works by taking the largest side of the current image , multiplying that with the percent value , and adding that portion to each side of the image . so for example , an image that ' s 100x100 , with 50 % padding percent , ends up resized to ( 50 + 100 + 50 ) x ( 50 + 100 + 50 ) , or 200x200 . the 100x100 portion is then centered , taking up what looks like 50 % of the final image . the same 100x100 image , with 100 % padding , ends up at 300x300 , looking in the final image like it takes up ~ 33 % of the space . padding can also be negative , which eats into the space of the original asset , causing a zoom in effect .
