Github url


by sylnsfar

sylnsfar /qrcode

artistic QR Code in Python (Animated GIF qr code)- Python 艺术二维码生成器 (GIF动态二维码、图片二维码)

7.6K Stars 1.2K Forks Last release: Not found GNU General Public License v3.0 76 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:




Python QR Code Generator

Generate common qr-code, artistic qr-code (black & white or colorized), animated qr-code (black & white or colorized).




# via pip
pip(3) install myqr(or MyQR)


Terminal Way

(TIPS: If you haven't install MyQR, you should

instead of

# summary
myqr    Words
        [-v {1,2,3,...,40}]
        [-l {L,M,Q,H}]
        [-n output-filename]
        [-d output-directory]
        [-p picture_file]
        [-con contrast]
        [-bri brightness]

Common QR-Code

#1 Words
  • Just input a URL or a sentence, then get your QR-Code named 'qrcode.png' in the current directory.

#2 -v, -l
myqr -v 10 -l Q
  • The default size of QR-Code depends both on the numbers of words you input and the level, while the default level (Error Correction Level) is H (the highest).

  • Customize: If you want to control the size and the error-correction-level, use the


representing the length is from a minimum of 1 to a maximum of 40.

representing the error correction level is one of L, M, Q and H, where L is the lowest level and H is the highest.
#3 -n, -d
myqr   -n github_qr.jpg   -d .../paths/
  • The default output-filename is 'qrcode.png', while the default output-directory is current directory.

  • Customize: You can name the output-file and decide the output-directory. Notice that if the name is as same as a existing file, the old one will be deleted.

representing the output-filename could be in the format one of

means directory.

Artistic QR-Code

#1 -p
myqr -p github.jpg
  • The
    is to combine the QR-Code with the following picture which is in the same directory as the program. The resulting picture is black and white by default.
#2 -c
myqr -p github.jpg -c
  • The
    is to make the resulting picture colorized.

#3 -con, -bri
myqr -p github.jpg [-c] -con 1.5 -bri 1.6
  • The

    flag changes the contrast of the picture - a low number corresponds to low contrast and a high number to high contrast. Default: 1.0.
  • The

    flag changes the brightness and the parameter values work the same as those for
    . Default: 1.0.

Animated GIF QR-Code

The only difference from Artistic QR-Code mentioned above is that you should input an image file in the

format. The you can get your black-and-white or colorful qr-code. Remember that when you use
to customize the output-filename, then the output-filename must end by

Import Way

# after installation
from MyQR import myqr
version, level, qr_name =

details about each parameter are as mentioned above

# help(myqr)
Positional parameter
   words: str

Optional parameters version: int, from 1 to 40 level: str, just one of ('L','M','Q','H') picutre: str, a filename of a image colorized: bool constrast: float brightness: float save_name: str, the output filename like 'example.png' save_dir: str, the output directory


  • Use a nearly square picture instead of a rectangle one.

  • If the size of the picture is large, you should also choose a rightly large

    instead of using the default one.
  • If part of the picture is transparent, the qr code will look like:

You can change the transparent layer to white, and then it will look like:

Supported Characters

  • Numbers:

  • Letters:

    a~z, A~Z
  • Common punctuations:

  · , . : ; + - * / \ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and  (space)


(TIPS: Without a installed MyQR, you should use

pip install -r requirements.txt
to ensure you have all dependencies.)


  • Linux, Python 3
  • Windows, Python 3
  • Mac, Python 3


  • GPLv3

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.