/qr-code-generator

Python script for generate qr code with your logo

Primary LanguagePythonMIT LicenseMIT

QR Code Generator with Logo Overlay

This Python script generates a QR code with a specified URL or text and overlays a logo in the center. It uses the qrcode and PIL (Pillow) libraries to achieve this.

Prerequisites

Make sure you have Python installed on your machine. Install the required libraries using the following command:

pip install qrcode[pil]

Usage

  1. Replace Logo_link with the path to your logo image.
Logo_link = 'path/to/your/logo.png'
  1. Adjust the basewidth variable to set the desired width for the QR code.
basewidth = 100
  1. Set the url variable to the desired URL or text for the QR code.
url = 'https://example.com'
  1. Optionally, change the QRcolor variable to set the fill color of the QR code. You can add color code html for the colors
QRcolor = 'black'
  1. Run the script:
python python .\qrcode-gen.py

The generated QR code with the logo overlay will be saved as mygithubqr.png.

Example

mygithubqr

Customization

Feel free to customize the script according to your needs. If you encounter any issues or have suggestions, please open an issue.

Dependencies

Credits