static BufferedImage combineBWImagesToColor(BWImage img1, Color color1, BWImage img2, Color color2) { int w = img1.getWidth(), h = img1.getHeight(); int[] pixels = new[w*h]; int i = 0; for y to h: for x to w: { pixels[i++] = colorToIntOpaque(addColors( blendColor(Color.black, color1, img1.getPixel(x, y)), blendColor(Color.black, color2, img2.getPixel(x, y)))); } ret intArrayToBufferedImage(pixels, w, h); }