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