static BufferedImage pixelateImage(int tempWidth, BufferedImage img) { int w = img.getWidth(), h = img.getHeight(); int tempHeight = widthToHeight(tempWidth, img); var img2 = scaledBufferedImageFromIntegralImage(tempWidth, img); ret scaleBufferedImagePixelated(img2, w, h) }