This is example of how to create transparent QR code with ZXING library:
QRCodeWriter qrCodeWriter = new QRCodeWriter();
// create output image
BufferedImage image = new BufferedImage(382, 382, BufferedImage.TYPE_INT_ARGB);
// create bit matrix
BitMatrix bitMatrix = new MultiFormatWriter().encode(
qrCodeString,
BarcodeFormat.QR_CODE, 382, 382);
// set pixels of output image based of bit matrix (black or translucent)
for (int i = 0; i < 382; i++) {
for (int j = 0; j < 382; j++) {
image.setRGB(i,j, bitMatrix.get(i,j) ? Color.BLACK.getRGB() : Color.TRANSLUCENT);
}
}
// write output image as png
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ImageIO.write(image, "PNG", outputStream);