20081116

How to - make your own QR Code

[if you watch CSI:NY on CBS, the episode last week featured QR codes on the back of the 'tell all' stationary that was part of the murder investigation]

I have already shown how you can decode a QR code - and now you want to create a QR code of your own. Start by going to the Google Chart API developers guide. In addition to the standard line charts, bar charts, pie charts, Venn diagrams and maps - the Google Chart API also supports QR codes.

You call the API just as you would call any other image that you would link to;

http://chart.apis.google.com/chart?cht=qr&chl=URL:http://www.strongholddigitalservices.com&choe=utf-8&chs=200x200&chld=Q|10
  • Chart AP - http://chart.apis.google.com/chart?
  • Chart type - cht=qr
  • Data to encode - chl=URL:http://www.strongholddigitalservices.com
  • Encoding - choe=utf-8
  • Size (in pixels) - chs=200x200
  • Error correction | margin - chld=H|5
Note - the amount of data will determine how many bits are in the QR code. The size just determines how big the output will be.

The Error correction letter says defines how much of the QR code can be missing or obscured, while still allowing the data to be retrieved. The 'H' code allows up to 30% of the image to be missing or obscured, and still able to maintain the data.

Here are some samples to illustrate the differences.

Size 200x200, Error Correction = H


Size 100x100, Error Correction = H



Size 200x200, Error Correction = L (worst, only 7% error/missing/obscure)

All three images contain the exact same data - but they differ only in size (between 1st and 2nd) and data correction (1st and 3rd).

Now - why has Google gone to such trouble to include the QR code in their Chart library? I don't know for sure - but it happens to be part of their Android mobile phone OS on TMobile's G1 handset. Beyond that - we will have to see if these start showing up and get adopted by more than just the twenty-something's.

No comments: