code: private static Image imageFromMatrix(BitMatrix matrix) {
          int height = matrix.getHeight();
          int width = matrix.getWidth();
          WritableImage image = new WritableImage(width, height);
          for (int y = 0; y < height; y++) {
              for (int x = 0; x < width; x++) {
                  Color color = matrix.get(x,y) ? Color.BLACK : Color.WHITE;
                  image.getPixelWriter().setColor(x, y, color);
              }
          }
          return image;
      }
docs: Create a JavaFX Image from a BitMatrix
  @param matrix the matrix
  @return the QRCode Image