Urgent.News

What's breaking now, across thousands of outlets.

Tech

Dithered QR Codes

Article URL: https://www.andrewt.net/dithered-qr-codes/wtf/ Comments URL: https://news.ycombinator.com/item?id=49226742 Points: 229 # Comments: 17

QR codes are a method of encoding data in a way that can be easily read by smartphones or similar devices. They consist of a grid of squares divided into function patterns and data modules. The function patterns help the scanner locate the QR code, while the data modules contain the actual information. Brands may modify the data modules to create distinctive QR codes, but this can reduce scanning robustness.

One way to modify the modules is by shrinking them and using the middle pixel to store data, while the rest serves as a photo. This results in a low-resolution, one-bit image with noise. The dithering process, such as Floyd-Steinberg dithering, can be used to improve the image quality by diffusing errors to surrounding pixels, making the image appear cleaner.

However, this results in a noisy image due to the inherent noise in the QR code data modules. To address this, the generator tool can allow changing a few of the error-prone data modules, as QR codes have error correction that can accommodate such changes. The ultimate trade-off is between aesthetics and scannability, with more redundancy needed for QR codes appearing on less stable surfaces like paper flyers.

Written by urgent.news from Hacker News Best's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at andrewt.net →

More in Tech

My server is a phone now

Article URL: https://seg6.space/posts/phone-server/ Comments URL: https://news.ycombinator.com/item?id=49226636 Points: 218 # Comments: 84

More from Saturday 8 August →