Wednesday, December 15, 2010

The pictorial representations of text: QRcodes

Quick Response codes. I think this is a passing fad, but, right now there seems to be some interest in 1D and 2D barcode like pictorial information ciphers. Hence my two pennys.

QRcode applications are one of the more popular uses of Augmented Reality systems. AR provides possibilities for really interesting use cases.

(Go! Google! Explore! :) )

QRcodes (and other 1D/2D barcode-like image formats) are useful in several ways, always as pictorial representations of textual information. 'Text to Image' encoding, if you will. The fundamental is that I can take any piece of text and encode it as a picture which can be read using a QRcode reader. Google's example implementation uses this to encode calendar events, contact info including email and phone number (a very cool use case, I must say - my visiting card can carry my QRcode), URLs and even WiFi network credentials! I have a link to this implementation later in this post.

The most common use, however, is to let a QRcode redirect you to a URL. Here, for the purposes of example and for self-recursive trumpet touting brag boast is the QR code to this blog:

What you'd typically do is switch on the QRcode reader in your mobile device, point it to this image and as soon as the three boxes (see the top, bottom and right) match the QR application's markers, it will direct your mobile browser to the URL of this blog.


Here's another:


'twas a dark and stormy blogThis one actually takes you to my fiction/non-tech-rants blog-site. I am shameless.



Okay, you can read more about QRcodes all around the place. Here's some stuff to give you a head start:


If you are looking for an open source library that does everything QR (and barcodes and more!), look no further than Google's own 'Zebra Crossing' (ZXing) project:


Google ZXing Home


If you are looking for a QR code generator, here's a simple one (based on ZXing):


createQRcode



and here's a more comprehensive, more advanced QR code generator from Google (again using ZXing):


ZXing QRcode Generator


...and of-course the token Wikipedia article:


QR Code article on WikipediaThere's two more links to consider:


1. Denso-Wave's (the creators of the QRcode format) site on QR codes: http://www.denso-wave.com/qrcode/index-e.html


2. A tutorial that I found useful (there's bad english in there, so snobs beware!): http://www.swetake.com/qr/qr1_en.html


The Denso-Wave site is recommended reading! tells ya all about versions, the amount of info that can be encoded, levels of error correction etc.


Good Stuff!



Printing:


This is the fundamental interaction that QRcodes empower. I spot a QRcode in real life and can immediately access the digital information that it serves. QR codes work like real life hyperlinks! Neat stuff!


Stands to reason that printing a QR code must be given due consideration. Of the different materials and processes, owing to their hard edges and high contrast, I think these codes lend themselves to screen printing (and digital printing) processes really well.


Typically what works best for printing is a vector image of your QRcode: InkScape and Bee Tagg help (Bee Tagg also has a very interesting alternative pictorial cipher that is based on hexagons. Its called, bee tagg - what else!).  However, both of these are limited to the "re-direct to a URL" usecase, they do not seem to support free-form embedding of text. Sigh!


However, in the bitmap world, what worked best for me was Photoshop. QRcode images are just a lot of boxes, if you resize them in Photoshop things turn out fine, except in some cases there may be slight blurring of edges. To remedy this, I just check "Resample Image" in the Image Size dialog box and select "Nearest Neighbor" as my algorithm of choice. So, you can use Photoshop to increase the size and resolution of the images that any of the generators (above) give you and print them up just fine!


I have not tested the printing of QR codes on curved surfaces. Not tested how well they can be read from various applications that is. You can still decorate your coffee mug or t-shirt with a QR code if you want to, how well these are read by a mobile device is what I am unaware of. Do let me know if you have any test results.


However, I think it is just a matter of time that there is a better image format that suits a wider array of applications, printing on straight and curved surfaces, supports greater error correction and is even more pleasing to the eye! This is why I think QRcodes and such like (as we see them now) are just a fad. There could be, for example, subtle variations of color, tone, edges etc - invisible to the casual observer's naked eye - encoded into regular images! Now that would pretty-fy things a lot! I can have my URL encoded into my logo, or my contact info encoded into my passport photograph. That is where I think all this should be headed.


But till such a time comes, enjoy looking at zebra images and thinking of all the coolth it serves. :)


---


By the way, if you are looking for a QRcode reader for your mobile, you are looking in the wrong place (...hahaha!), you should be looking at your mobile's app market place.


cheers :)


No comments: