5 ms·
Dithered QR Codes
- jmusall 2mo agoCoincidentally came across this after reading a comment [1] under the recent post on _for-sale DNS records, visiting milk.com and scrolling through the owner's Mastodon [1] https://news.ycombinator.com/item?id=49224882 https://news.ycombinator.com/item?id=49224882
- Zecc 2mo agoI recognize the domain name from playing some of his daily puzzles, namely Ronin and Cell Tower. https://www.andrewt.net/puzzles/ https://www.andrewt.net/puzzles/
- mentat 2mo agoThis made me wonder if you could do it with color and apparently you can: https://1mentat.github.io/qr-code-shenanigans/ https://1mentat.github.io/qr-code-shenanigans/
- BobbyTables2 2mo agoNice writeup! Only needs a Rick Astley QR code (;->
- OscarCunningham 2mo agohttps://www.reddit.com/r/Damnthatsinteresting/comments/ublxtm/i_encoded_this_qr_code_to_show_the_video_the_code/ https://www.reddit.com/r/Damnthatsinteresting/comments/ublxt...
- ideasphere 2mo agoIs that Lena with Sean Connery’s face??
- eru 2mo agohttps://mortenhannemose.github.io/lena/ https://mortenhannemose.github.io/lena/ I suspect.
- hmry 2mo agoThat's absolutely hilarious
- userbinator 2mo agoLOL! It's a sign of the times that, before I saw the year, I thought "that has to be AI generated", because this sort of outlandish silliness is exactly the type of thing that genAI excels at.
- OscarCunningham 2mo agoBy the same author: https://mathstodon.xyz/@andrewt/115056697540191327 https://mathstodon.xyz/@andrewt/115056697540191327
- zahrevsky 2mo agoYou can also run animations in QR codes: https://cgv.cs.nthu.edu.tw/Projects/Recreational_Graphics/Halftone_QRCodes/ https://cgv.cs.nthu.edu.tw/Projects/Recreational_Graphics/Ha... So, technically, you can run Doom inside a QR code?
- sphars 2mo agoI'm now waiting for someone to post the Bad Apple meme but all in QR codes
- OscarCunningham 2mo agohttps://pony.social/@luna/115057532794342459 https://pony.social/@luna/115057532794342459
- vpzom 2mo agoit's been done a couple of times :) Here's my version that still keeps the full squares: https://youtube.com/watch?v=qQkWjzqMbuA https://youtube.com/watch?v=qQkWjzqMbuA
- mi_lk 2mo agoI like the writing style. The first section is super clear about what QR code is in ~200 words
- unkl_ 2mo agoYou can use colour as well: https://janglingpointer.github.io/Image_To_QR/ https://janglingpointer.github.io/Image_To_QR/ The guy that made that did a writeup on reddit: https://www.reddit.com/r/PixelArt/comments/1v52x96/ https://www.reddit.com/r/PixelArt/comments/1v52x96/
- gblargg 2mo agoThis reminds me of car safety features, how drivers have become more complacent to offset the benefits. QR codes were made to be robust in the face of errors, but over time this has been eaten into for aesthetic purposes. Businesses commonly put a logo in the center, eating up some error correction budget. This likely has a similar effect.
- jerf 2mo agoA few weeks ago I saw the first QR code I've personally witnessed that I'm pretty sure is completely unscannable. The company logo stretched well out of the center block. It was on the back of a semi in the Chicago area. I didn't get the greatest shot of it on my phone (as a passenger), because it was driving away as I tried, so it wasn't quite proof it couldn't scan, but I'm pretty sure it ate more than 100% of the error correction margin. Based on the trends, I expect it is only the first of several I will see.
- arjie 2mo agoI’ve run into a few of these. And yesterday some kind of payment scanning QR code at SF’s Filipino Pistahan festival didn’t scan and I had to type in the text below. Annoying.
- theandrewbailey 2mo agoDoesn't everyone QA their QR codes? I thought it would be as obvious as making sure you got the right address and/or phone number on an ad before distributing it.
- masfuerte 2mo agoYou'd think. My local authority is reorganising refuse collection and did a mailshot to let everyone know the new collection rota. Then they did another because the dates on the first one were wrong. The incompetence is staggering.
- gblargg 2mo agoMaybe they do. Do QR code decoder authors QA their decoders to be sure they are getting high accuracy of the raw data? You could make a poor decoder that relies on the error budget to work, while someone checked with a high-quality decoder. Tech with error correction invites corner-cutting. Hard drives, flash storage, even DDR5 RAM does this. Use crapper representation or reading devices and just add more error correction.
- petters 2mo agoThese are also very cool: https://antfu.me/posts/ai-qrcode https://antfu.me/posts/ai-qrcode Diffusion image generation constrained to also be a valid QR code
- benj111 2mo agoI find it slightly disconcerting that lena has a mustache.
- hellojomp 2mo agoThis is really neat! A question I had about QR codes: Let’s say I want to produce a QR code that is as close as possible to an image (let’s say the Nike swoosh logo), if I just added that to the center and added the 3 orientation markers on the corners it wouldn’t be a proper QR code yet, my question is what is the minimal amount of edits I would need to do from that symbol to get a valid QR code? I’m thinking of something like people buying and hoarding domains in early 00’s (even now), if I could generate the minimal QR code (minimal is important here in the same way that .com is treated as superior to .ca or .net) of well-known symbols and buy the resulting domain it points to (if it even points to a domain) couldn’t I sell this to companies with the associated domain as a re-direct as well?
- OscarCunningham 2mo agoYou could maybe determine this using a SAT solver. You would have to encode the entire QR code specification. I was thinking of doing this to find a minimalist QR code that just had as few black cells as possible.
- jmusall 2mo agoFrom another comment: https://research.swtch.com/qart https://research.swtch.com/qart Looks like this is definitely possible, the results aren't as clean as you might hope though. Maybe they could be improved by introducing some intentional errors (which were explicitly avoided here).
- Diti 2mo agoUsing their logo in this way is probably a trademark violation, so they would be able to get your QR code “for free” (minus the costs involved with consulting their legal division).
- ButlerianJihad 2mo agoGreetings, I could not find any LICENSE file or statement on the Codeberg repo. We must therefore conclude that the code is © Copyright 2025-2026, by the author(s), all rights reserved. Crazy to think there are already 3 forkers who've forked you. Furthermore, let us not forget the patent-holder of QR Codes, DENSO WAVE, and their Frequently Asked Questions: https://www.qrcode.com/en/faq.html https://www.qrcode.com/en/faq.html Users of QR Code must be careful about deforming the code by overlaying it with an illustration or putting a a design on it. If it is deformed, the QR Code's error correction function is invoked where even a tiny missing or smeared part renders the reading operation impossible, or the response of the operation may become slow. If you are contemplating arranging an illustration or design involving a QR Code, please consult with DENSO WAVE about your project beforehand.
- jmusall 2mo agoAs far as I can tell the specification only demands the code modules (pixels) to be square (which is already often ignored in "aesthetic" QR codes which use e.g. round dots instead) and arranged in a square grid. Not that each grid cell has to be filled completely by the respective module. So this might actually be compliant!
- NooneAtAll3 2mo agoI'm not impressed. the whole technique hinges on qr scanners reading only middle point of the squares The moment you encounter developer that thought "for redundancy let's sample the whole square" (which is a very natural thought) - it breaks I kinda expected working the limits of error correction, honestly. Not this blunt circumvention "because it works on my machine"
- Jaxan 2mo agoThe specification of qr codes says you should look only at the centres, iirc.
- jmusall 2mo agoI think sampling "the whole square" might actually not be that good for decoding even standard QR codes as aliasing at the edges of each code module ("pixel" of the code) in a camera image would actually make the distincion between 1s and 0s more difficult. Your argument still partially applies though, as introducing new unrelated colors at the module edges could also lead to aliasing effects when the code is too small for example.
- shivam310 2mo agoPretty cool!
- wvbdmp 2mo agoThat’s very cool, but I’d be worried most regular people wouldn’t recognize it as a QR code and never scan it in the first place.
- arjie 2mo agoI think the first time I saw this was the Stable Diffusion controlnet that did the trick. Definitely an entertaining trick https://latentcat.com/en/blog/qrcode-controlnet https://latentcat.com/en/blog/qrcode-controlnet
- blululu 2mo agoThe approach in the article using dithering is in some sense more elegant and mathematically clever. But the level of visual representation from control nets/SD is really compelling.
- dhosek 2mo agoI played around with this a bit, first I did a photo of a cat I just took at a cat cafe, but the black and white cat didn’t turn out well with the dithering algorithm, so then I tried a selfie and pushing the radius up, it came out looking good, but then I tried aiming my iPhone camera at the screen and it didn’t see a QR code, only the face from the selfie. The ones on the main page, though, worked fine.
- zellyn 2mo agoI always think of Russ Cox’s blog posts as canonical here: https://research.swtch.com/qart https://research.swtch.com/qart
- 0sp 2mo agoRuss Cox’s QArt Codes[0] modifies how the URL is encoded to embed an image while keeping the QR code fully valid, without relying on error correction. [0] https://research.swtch.com/qart https://research.swtch.com/qart Related QArt discussions on HN: [1] https://news.ycombinator.com/item?id=15213044 https://news.ycombinator.com/item?id=15213044 (2017-09-10, 61 points, 6 comments) [2] https://news.ycombinator.com/item?id=3836935 https://news.ycombinator.com/item?id=3836935 (2012-04-13, 56 points, 9 comments) [3] https://news.ycombinator.com/item?id=8549772 https://news.ycombinator.com/item?id=8549772 (2014-11-03, 56 points, 4 comments)
- PaulHoule 2mo agoYou can alpha blend a QR code onto images easily and fit them into graphic designs https://mastodon.social/@UP8/115939341268444811 https://mastodon.social/@UP8/115939341268444811 https://mastodon.social/@UP8/113494337763505908 https://mastodon.social/@UP8/113494337763505908 (R&D)
- jcelerier 2mo agothe two last one didn't scan at all on my phone :/
- qqilihq 2mo agoOnce you understand how QR codes work it is more about "creativity" of what you want to do with your options! Next to shapes, contrast you can also use color and mix design approaches. https://qrocodile.io https://qrocodile.io is a free tool that tries to push those limits of QR codes and keep it scanable and recreatable (vs. 1-time AI generated codes). It has a module based approach, so each module (pattern) can have a different approach on how to render a QR. I think a dithered QR code module is missing... something that could be added! :)
- ddasdasdsa 2mo ago[flagged]