A simple Python CLI tool to generate QR codes from URLs. Supports optional logo embedding in the center of the QR code.
- Generate QR codes from any URL or text
- Optional logo/image embedding in the center
- ASCII preview in terminal
- Saves as PNG file
- Python 3.6 or higher
pip install -r requirements.txtOr install manually:
pip install qrcode[pil] Pillowpython createqrcode.py 'https://example.com' output.pngpython createqrcode.py 'https://example.com' output.png --logo logo.png| Argument | Required | Description |
|---|---|---|
url |
Yes | The URL or text to encode in the QR code |
output_file |
Yes | The output PNG file path |
--logo |
No | Path to a logo image to embed in the center |
Generate a simple QR code:
python createqrcode.py 'https://github.com/min-hsao' github-qr.pngGenerate a QR code with your company logo:
python createqrcode.py 'https://mycompany.com' company-qr.png --logo company-logo.png- When no logo is specified, the script uses low error correction (ERROR_CORRECT_L) for a cleaner QR code
- When a logo is added, it automatically switches to high error correction (ERROR_CORRECT_H) to ensure the QR code remains scannable
- The logo is automatically resized to 25% of the QR code size
MIT License - see LICENSE for details.
Min-Hsao Chen