Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 

Repository files navigation

QR-Generator-using-Python

๐Ÿ“ฑ Python QR Code Generator with Logo

A simple Python project that generates a custom QR Code and embeds a logo at the center using the qrcode and Pillow libraries. This project demonstrates how to create visually appealing QR codes while maintaining their scannability.


โœจ Features

  • Generate QR codes for any website, text, or URL.
  • Add a custom logo at the center of the QR code.
  • Automatically resize the logo.
  • Center the logo on the QR code.
  • Supports transparent (RGBA) logos.
  • Saves the generated QR code as an image.

๐Ÿ› ๏ธ Technologies Used

  • Python 3.x
  • qrcode
  • Pillow (PIL)

๐Ÿ“ฆ Installation

Install the required libraries:

pip install qrcode[pil]

or

pip install qrcode pillow

๐Ÿ“‚ Project Structure

QR-Code-Generator/
โ”‚
โ”œโ”€โ”€ logo.png
โ”œโ”€โ”€ qr_generator.py
โ”œโ”€โ”€ qr_logo.png
โ”œโ”€โ”€ README.md

๐Ÿš€ How to Run

  1. Install the required libraries.
  2. Add your logo image (logo.png) to the project folder or provide the correct file path.
  3. Update the URL inside the code.
  4. Run the Python script.
python qr_generator.py

The generated QR code will be saved as:

qr_logo.png

๐Ÿ’ป Example Code

import qrcode
from PIL import Image

img = qrcode.make("https://google.com").convert("RGB")

logo = Image.open("logo.png").resize((60,60))

x = (img.width - logo.width) // 2
y = (img.height - logo.height) // 2

img.paste(logo, (x,y), mask=logo if logo.mode=="RGBA" else None)

img.save("qr_logo.png")

๐Ÿ“– How It Works

  1. Generates a QR code from the provided URL.
  2. Opens the logo image.
  3. Resizes the logo.
  4. Calculates the center position.
  5. Places the logo at the center.
  6. Saves the final QR code.

๐Ÿ“ธ Output

The program creates a QR code similar to this:

  • โœ… QR Code
  • โœ… Custom Logo in the Center
  • โœ… Ready to Scan

๐Ÿ”ฎ Future Enhancements

  • Generate colored QR codes.
  • Add custom QR code styles.
  • Create a graphical user interface (GUI).
  • Accept user input for URLs.
  • Generate QR codes in different formats (PNG, SVG).

๐Ÿ‘ฉโ€๐Ÿ’ป Author

Santhoshi M

๐Ÿ”— GitHub: https://github.com/Santhoshi2010

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages