sclass BenchDrawingImageOnImageWithAlpha { int w = 1000, h = w; long nanos; settable int alphaValue = 0x80; // is alpha 0 (draw nothing) or alpha 255 (draw opaque) faster than other values? run { int[] pixels = repIntAsArray(w*h, -1); var img = bufferedImageWithoutAlpha(w, h, pixels); pixels = repIntAsArray(w*h, alphaValue << 24); var img2 = bufferedImageWithAlpha(w, h, pixels); var g = graphics(img); nanos = benchFor5("draw " + nPixels(w*h), -> drawImage(g, img2)); print("Fastest result: Can draw " + n2(w*h*1000/nanos) + " MPixels/s"); } } svoid benchDrawingImageOnImageWithAlpha() { new BenchDrawingImageOnImageWithAlpha().run(); }