BufferedImage diff = new BufferedImage(ref.getWidth(),
ref.getHeight(),
BufferedImage.TYPE_INT_ARGB);
Vector src = new Vector();
src.addElement(new BufferedImageCachableRed(ref));
src.addElement(new BufferedImageCachableRed(gen));
CompositeRed cr = new CompositeRed(src,
CompositeRule.ARITHMETIC(0, 10, -10, 0.5f));
cr.copyToRaster(diff.getRaster());