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.
Make sure you have Python installed on your machine. Install the required libraries using the following command:
pip install qrcode[pil]
- Replace
Logo_link
with the path to your logo image.
Logo_link = 'path/to/your/logo.png'
- Adjust the
basewidth
variable to set the desired width for the QR code.
basewidth = 100
- Set the
url
variable to the desired URL or text for the QR code.
url = 'https://example.com'
- 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'
- Run the script:
python python .\qrcode-gen.py
The generated QR code with the logo overlay will be saved as mygithubqr.png
.
Feel free to customize the script according to your needs. If you encounter any issues or have suggestions, please open an issue.