code: public static BufferedImage compression(BufferedImage src, int widthScale, int heightScale) {
          int oldWidth = src.getWidth();
          int oldHeight = src.getHeight();
          int width = oldWidth / widthScale + ((oldWidth % widthScale) > 0 ? 1 : 0);
          int height = oldHeight / heightScale + ((oldHeight % heightScale) > 0 ? 1 : 0);
  
          BufferedImage dest = new BufferedImage(width, height, src.getType());
  
          for (int x = 0; x < width; x++) {
              for (int y = 0; y < height; y++) {
                  int rgb = src.getRGB(x * widthScale, y * heightScale);
                  dest.setRGB(x, y, rgb);
              }
          }
  
          return dest;
      }
docs: 缩放图片
  
  @param src         图片源
  @param widthScale  宽度缩放比例
  @param heightScale 高度缩放比列
  @return 缩放后的图片（会变模糊）