Animated QR codes: How do they Work, and how to Create your Own?
Two-dimensional (2D) barcodes, more prominently recognized as QR codes, are back in fashion—with much demand for just about ‘contactless’ everything these days.
Coinbase didn’t waste time in seizing this opportunity either: its genius Superbowl 2022 TV ad was nothing but a mysterious QR code against a pitch-black background aimed at capturing your attention totally.
Even those who may not understand how exactly these quirky-looking squares work have pretty much used them at some point.
But, is there such a thing as moving or animated QR codes? And could they work?
Scan it for yourselves.
This week, technologist, “cyborg hardware hacker,” and YouTuber, Zack Freedman tweeted a GIF that’s gone viral.
The GIF shown below contains an animated QR code with moving frames that some might recognize—a sequence from Rick Astley’s famous Never Gonna Give You Up music video.
Lyrics from the song and the music video itself have been a popular meme for the longest time used by netizens and even malicious actors trolling hacked companies.
Also Read: 13 Special Skills To Become a Front End Developer Singapore
But, other than being an artistic barcode, Freedman’s GIF actually works as a QR code: scan it for yourselves!
Assuming your QR code scanner app works, the above GIF will lead you to the official Never Gonna Give You Up music video on YouTube.
This unexpected turn left many amazed, with some calling it a “weird wizardry,” “LEGEND,” and one even complaining that YouTube began “rate-limiting” the video due to excessive traffic.https://a65d2ae36f9df745913af9d958775319.safeframe.googlesyndication.com/safeframe/1-0-38/html/container.html
In fact, there exist online tools, like the one created by QR4 and software engineer Jeroen Steeman, allowing you to create your own animated QR codes!
Diving deeper into barcodes
The origins of barcodes date back to the 1950s when two graduate students at Drexel University (ahem, my alma mater) patented a system for easy cataloging and looking up of electronic product information.
What may have originally started out as an inventory-tracking concept, however, evolved in terms of complexity, available formats, and even dimensions, with the advent of 2D barcodes.
Commonly known as QR (Quick Response) codes, these matrices are just one type of 2D barcodes, invented in 1994 by Japanese automotive firm Denso Wave, which still holds the trademark to the term ‘QR Code’ and even a patent on the technology.
While one-dimensional barcodes, like the UPCs you see on book covers and merchandise, are capable of holding simple one-liner strings—such as an SKU, item number, or another set of characters up to a certain length (around 85 characters), 2D barcodes are far more versatile in their capacity to hold data, the ability to hold different types of data, and various error checking and correction mechanisms built into them.
Also Read: Top 4 Advantages Of Opting For WordPress Developer Singapore
2D barcodes, as the name implies, have multiple dimensions and can store data across the entire matrix, as opposed to just a single line (dimension). And each part of the QR code matrix has a special meaning and role to play, with the content-holding section being just one part of the entire matrix.
The error checking and correction aspects of 2D barcodes are important in the sense, that even if parts of the QR code are cut off or corrupted, the QR code may still continue to scan correctly and retain the content stored inside it. Try it for yourself:
This isn’t the case for 1D barcodes—these work by the scanner calculating the ratio of widths of straight bars next to each other. And as such, if you cover up or destroy a part of the 1D barcode, it may not scan correctly.
But, the very error correction mechanism built into QR codes allows barcode creators to get creative: to pack functional content (such as a URL or another piece of data) in a small part of the entire matrix, with other parts of the matrix serving essentially as a blank canvas for artistic imagery:
This explains why artistic barcodes, like the one shown above, or the panther QR code GIF in the beginning may continue to scan correctly: the areas of the QR code containing the functional data (URL) are a smaller part of the entire matrix.
In the case of the panther GIF above, the pixels (and hence areas of QR code) around the moving panther are relatively static, and this is where the content might be present, rather than the center where the animation plays.
But, what’s going on in Freedman’s GIF appears to be a tad more complicated. Each frame of the GIF changes the QR code almost entirely, with pixels rearranging themselves.
For those well-versed in computer vision, Twitter user and tech blogger BenBE may have an answer for you: