static BufferedImage twoColorImage(Color bg, Color fg, IBinaryImage image) { int fgInt = colorToInt(fg), bgInt = colorToInt(bg); ret image == null ?: bufferedImageFromFunctionWithoutAlpha( image.getWidth(), image.getHeight(), (x, y) -> image.getBoolPixel_noRangeCheck(x, y) ? fgInt : bgInt); }