Saturday, November 12, 2011

Add a Logo to Your QR Code

A few days ago I posted a blog about creating your QR Codes for free. Reader Sean gave me a link to a very cool web site called Hack a Day.

After a very minor investigation, I was able to place my logo into a scannable QR Code. Like this:
http://www.smallbizthoughts.com/images/QR_SBT_logo.png

I'll let you review that blog post. But here are the basics.

QR Codes consist of primarily black and quite pixels. These are placed in squares so that a scanner can easily identify the black vs. white and return a scan result in a timely manner. There are some basic elements of the QR Code construction, such as the three large squares to anchor the scan. Then there are "timing" patterns across the top and left side of the QR Code.

In addition, there are a few areas you can't touch, and lots of space for data to be written.

The QR Code we use today is based on a standard created by DENSO WAVE in 1994. See the spec at QR Code.com. Denso owns the patent but has allowed the code structure to become "open" by not enforcing their patent rights. Because the code pattern is interpreted both horizontally and vertically, it is basically a large mathematical matrix that can store a lot more data than a "bar code" such as an ISBN.

One other cool feature is built into the QR Code: It is intended to provide valid information even if the code is dirty, obscured, or damaged. For example, if your FedEx box gets scraped and the QR Code is only partially complete, it can still work . . . to a point. The important point here is that the QR Code graphic can be "polluted" and it will still work.

Another cool feature is that checksums are built into the QR Code spec. That's what makes them work even if obstructed. You can choose the error correction level. Depending on how you construct your QR Code, up to 30% of the codewords (one codeword = 8 bits of data) can be restored from checksum.

So . . . If you can have a distorted or polluted QR Code, and you know that a fairly high percentage of the code can be obscured with no effect on the result . . . then you can play with putting your own graphics into the code. For Example, these two codes both return the exact same result:

 

Note that a more complicated QR Code will actually let you distort a larger space.

To accomplish this, first create the QR Code you want. Then you have two options: the hard way or the easy way. For the hard way, see the links above and figure out the math. The key to a "large" logo space will be to create a QR Code with error correction of Level H (30%).

Here's the easy way.

1. Generate a QR Code. You can use my QR Code Generator or find one at qrstuff.com or somewhere else.

2. Save the QR Code and make a copy. You'll edit the copy, of course.

3. Open your logo in your graphics program.

4. Select your logo with as tight a selection as possible (invisible background, not much edge, etc.).

5. Paste your logo into the QR graphic. Size as needed. The best locations are the center of the tag and the lower right hand corner.

6. To test, deselect your logo so the code appears "clean" and scannable. Then scan it from your monitor. If the logo is small enough, the code will scan.

7. If the code DOES scan right away, consider enlarging your logo. Keep making it larger until the scan fails. Then go back the the most recently successful version.

8. If the code DOES NOT scan, decrease the size of the logo. Keep testing until it works.

9. Save the result as a new file.

Note: You will want to work with a hi-res file at first and then make it a reasonable size for your medium (print, web, business card, etc.). Be sure to test, test, test.

One of the key factors to consider is speed. Because your phone is doing some error correction on the fly, you may be able to get a logo'd QR code to work after several scanning attempts. But you don't want that. You need the logo to be just a little smaller so the error correction is very fast and unnoticeable to the end user.

Finally, please note that most free QR Code generators on the Internet do not let you choose the error correction level, and do not provide a high error correction level. That means your logo is limited in size. There are several commercial packages that create bar codes and QR Codes. Start with a commercial package if you want to maximize the correction level and therefore your logo size.

:-)





Now Shipping:
The Network Migration Workbook:
Zero Downtime Migration Strategies for Microsoft Networks

2 comments:

  1. Glad you liked it. Especially for my QR code on my business card I found it looks much better with the logo in there. I've also seen the QR code inside the facebook thumb or the Google Plus +1 icon in the QR code. One other tweak I do a lot is change the color from black and white to two high contrast colors that match the color scheme of where it is going. For example, for Farmers Insurance I use Red and Blue QR codes.

    Also, I have my QR codes point to specific short URLs so I can get analytics on how many people clicked, err, scanned through.

    ReplyDelete
  2. So this is the code that we couldn't find Wednesday? It looks much better and more consumer oriented than a plain one. However, I still think QR codes won't be around consumers for too long. As you mentioned, they originated in the manufacturing sector, where function wins over aesthetics. Here's what will replace QR codes for consumers:

    http://news.yahoo.com/blogs/this-could-be-big-abc-news/qr-codes-things-185409346.html

    ReplyDelete

Feedback Welcome

Please note, however, that spam will be deleted, as will abusive posts.

Disagreements welcome!