QR Code Data Masking? Not finding any mention in decoders or generators.

308 views
Skip to first unread message

raccoon

unread,
Jul 21, 2016, 12:39:24 PM7/21/16
to zxing
Hi guys,

I've been looking (for years) for any code generators or decoders that support or imply support for "Data Masking" as per the ISO/IEC specification. This is the application of any one of 8 "data mask patterns" to the finished QR code (one of 4 patterns for Micro QR codes), to give variety to the aesthetic appearance and functional contrast of a code, ie, to avoid large blobs that may interfere with timing and decoding.

I notice that the relatively new zxing.appspot.com doesn't support data masking, and I would be interested to know if the main zxing library even provides decode support.

Regards,

R


P.S. Since the words "data mask" don't appear anywhere in this group's archive of posts, I'll include the mask functions here for quick reference.

000 (i + j) mod 2 = 0
001 imod 2 = 0
010 jmod 3 = 0
011 (i + j) mod 3 = 0
100 ((i div 2) + (j div 3)) mod 2 = 0
101 (i j) mod 2 + (i j) mod 3 = 0
110 ((i j) mod 2 + (i j) mod 3) mod 2 = 0
111 ((i j) mod 3 + (i+j) mod 2) mod 2 = 0

Where i refers to the row position of the module in question and j to its column position, with (i, j) = (0, 0) for the top left module in the symbol.

-R

Lachezar Dobrev

unread,
Jul 22, 2016, 5:22:10 AM7/22/16
to raccoon, zxing
  The Data Mask application in ZXing is automatic when encoding a QR Code. The library choose a best-fit one based on number of "penalty" metrics which lead to choosing the mask that will lead to the least deterioration artefacts in the result code.
  [1] com.google.zxing.qrcode.encoder.Encoder @ 57
  [2] com.google.zxing.qrcode.encoder.Encoder @ 229
  [3] com.google.zxing.qrcode.encoder.MaskUtil


-R

--
You received this message because you are subscribed to the Google Groups "zxing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zxing+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sean Owen

unread,
Jul 24, 2016, 1:36:38 PM7/24/16
to zxing
Masking is actually required and has always been implemented:
Certainly, the online encoder does it.
Reply all
Reply to author
Forward
0 new messages