For a project, we were asked to re-create the same QR code as on a pdf we received.
I managed to do almost the same but I can't find the solution. Here is the QR Code we need to recreate (I've added red arrows).
You see there is almost every time a pixel less and in another place a pixel more. Here's my QR Code except that I miss no pixel.
I'm using boofcv library and here is my code
QrCode qr = new QrCodeEncoder().setError(QrCode.ErrorLevel.M).setMask(QrCodeMaskPattern.M111).setVersion(1).addBytes("E-ALPZNUP").fixate();
QrCodeGeneratorImage render = new QrCodeGeneratorImage(42);
render.render(qr);
BufferedImage buffimage = ConvertBufferedImage.convertTo(render.getGray(),null);
If someone has the same solution with another library I can take it.
I know it's not my business to bother about why you have such requirement to generate exactly the same QR code, but my guess is that the 'extra' and 'missing' pixels of the original picture are due to the JPEG encoding of the image. I know it's in PNG, but maybe after generation it was encoded in JPEG and then back to PNG. There's no pattern at all when the pixel appears, so there must be something random or fuzzy which adds it to the first image. Alternatively, it's some kind of signature that they're adding to the original QR to identify that it was legitimately generated by a specific authority.
From reading perspective, they're both exactly the same and both QR codes will provide the same output.