static RGBImage subtractRGBImages(RGBImage image, RGBImage image2) { int w = image.getWidth(), h = image.getHeight(); RGBImage out = new RGBImage(w, h); for (int y = 0; y < h; y++) for (int x = 0; x < w; x++) { RGB a = image.getRGB(x, y), b = image2.getRGB(x, y); out.setPixel(x, y, fixRGB(a.r-b.r+0.5f, a.g-b.g+0.5f, a.b-b.b+0.5f)); } ret out; }