I also sometimes see QR codes that are inverted. Not all readers detect them but many enough do that they end up in print.
- Apple's barcode reader
- Google's ML Kit
- and ZXing, probably behind most third party QR code scanning apps
covers most QR code readers that users will actually use, so testing them is fairly easy.
The process starts by scanning for the 3 markers on the corners. That give you the square containing the qr content and it's orientation. The next jobs are figuring out the resolution of the square and the version of the qr code used. Eventually you end up knowing the grid dimensions. And then you simply scan the grid as the article outlines by simply averaging the pixels in each grid square to be "white" or "black". As long as you have enough contrast, most grid squares will scan correctly.
You can abuse this quite a bit before it starts breaking. There are some interesting QR codes out there that are barely recognizable as QR codes for people. But if you open them in an image editor and play with the levels and contrast a bit, they are obviously qr codes. And there's error correction too so it's OK if some of the qr code is scanned incorrectly.
All my research suggests these are reader implementation specific and not guaranteed to work per the official spec.
But I find it hard to believe these codes are becoming more prevalent if they aren’t guaranteed to read.
Anyone have more info on this?