Generated minimum possible sized QR code BitMatrix

145 views
Skip to first unread message

Jack F

unread,
Jul 14, 2014, 11:18:09 PM7/14/14
to zx...@googlegroups.com
I've been playing around with zxing in Java, and was trying to optimize QR code generation for speed. I assume that for a given QR code, there is a minimum sized binary matrix needed to represent it (where each index corresponds to a square of the QR code)? With the

QRCodeWriter.encode(dataString, BarcodeFormat.QR_CODE, outputWidth, outputHeight)

method, is their a way to achieve this minimal BitMatrix size? My plan was then to scale up the bitmap to the presentation size using createScaledBitmap (with antialiasing disabled) - which is very fast. Currently I am setting outputWidth & height to an arbitrary value of 100 - the bitmap is later scaled up to several 1000 pixels.

I had a look through the source for QRCodeWriter.java and Encoder.java - couldn't see anything obvious on how to do this but I might be missing something obvious. I've already tried setting width/height to 0 which seemed the obvious implementation, but that failed.

Hope to hear your thoughts
Jack

Lachezar Dobrev

unread,
Jul 15, 2014, 8:32:16 AM7/15/14
to Jack F, zxing
1x1 yields the minimum size matrix for the data size.
> --
> 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.
Reply all
Reply to author
Forward
0 new messages