<- Back

qr code

Encode
Generate from string
qrencode --output qr.png "This is my text"
-8
--8bit
-l
--level: specify error correction level from L (lowest) to H (highest). (default=L) {LMQH}
-o
--output: write image to FILENAME. If '-' is specified, the result will be output to standard output.
-t
--type: specify the type of the generated image. (default=PNG) {PNG,PNG32,EPS,SVG,XPM,ANSI,ANSI256,ASCII,ASCIIi,UTF8,UTF8i,ANSIUTF8,ANSIUTF8i,ANSI256UTF8}
--svg-path
use single path to draw modules for SVG.
Decode
Decode from .png file
zbarimg -1 --raw -q -Sbinary qr.png
Decode from camera
zbarcam -1 --raw -Sbinary

There are four modes to encode data:

Number Mode First 4 bits Allowed characters
1 Numeric 1 = 0b0001 [0-9]
2 Alphanumeric (only uppercase letters) 2 = 0b0010 [0-9][A-Z], space, $, %, *, +, -, ., /, :
3 Byte encoding (8 bits) 4 = 0b0100 ISO/IEC 8859-1
4 Kanji 8 = 0b1000 Shift JIS X 0208

qrencode will automatically decide which mode fits best. There is no way to specify numeric mode and fail if invalid letters are part of the encoded message. The only way to enforce a mode is to explicitly set –8bit.

There are four levels of error correction:

Error Correction Level Redundancy error_correction_level number
Level L (Low) 7% 1
Level M (Medium) 15% 0
Level Q (Quartile) 25% 3
Level H (High) 30% 2