code: public static BufferedImage toImage(BitMatrix matrix, int foreColor, int backColor) {
  		final int width = matrix.getWidth();
  		final int height = matrix.getHeight();
  		BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
  		for (int x = 0; x < width; x++) {
  			for (int y = 0; y < height; y++) {
  				image.setRGB(x, y, matrix.get(x, y) ? foreColor : backColor);
  			}
  		}
  		return image;
  	}
docs: BitMatrix转BufferedImage
  
  @param matrix BitMatrix
  @param foreColor 前景色
  @param backColor 背景色
  @return BufferedImage
  @since 4.1.2