static BufferedImage twoColorImageWithAlpha(Color newBlack, Color newWhite, IBinaryImage image) { int fgInt = colorToRGBA(newWhite), bgInt = colorToRGBA(newBlack); 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); }