When my iPhone is locked, I can still share my website address with anyone nearby. It is also handy if I ever leave my phone somewhere — whoever finds it can scan straight through to a page with my contact details. My solution for creating a wallpaper with a QR code combines Pinterest (or any favourite app for backgrounds) with reportlab, a Python library for generating PDFs and graphics such as barcodes and QR codes.
Introduction: iPhone Wallpaper with a QR Code
I have been using this approach for a while now. Since people keep asking me how I added a QR code to my iPhone wallpaper, I am sharing the full method here, once and for all.
Setting an iPhone Wallpaper
You probably already know how easy it is to use your own photo as an iPhone wallpaper: select your photo, tap the “Share” button, then choose “Use as Wallpaper.” That is it — you now have a unique wallpaper instead of the standard one.
Alternatively, use Midjourney, Pinterest, or another application to create your wallpaper background — you will add a QR code to it next.
Generating a QR Code in Python with reportlab
If you like Python, as most readers of this blog do, adding a QR code to a photo or any other image is a breeze. Here is how to do it with reportlab:
from reportlab.graphics import shapes, renderPDF
from reportlab.graphics.barcode import qr
from reportlab.pdfgen import canvas
# Creating screensaver for iPhone 12
output_pdf_filename = "/path/to/output.pdf"
width = 1170
height = 2532
pdf = canvas.Canvas(output_pdf_filename, pagesize=(width, height))
def draw_qr(text="https://daehnhardt.com", size=400):
qr_code = qr.QrCodeWidget(text)
bounds = qr_code.getBounds()
w = bounds[2] - bounds[0]
h = bounds[3] - bounds[1]
drawing = shapes.Drawing(size, size, transform=[int(size / w), 0, 0,
int(size / h), 0, 0])
drawing.add(qr_code)
renderPDF.draw(drawing, pdf, width / 2 - 230, height / 2 - 230)
pdf.save()
draw_qr()
One detail worth knowing: QrCodeWidget ignores any width and height you hand to the Drawing directly — it sizes itself according to how much data the QR code encodes. That is why the code calls getBounds() first and derives its own scale transform, rather than trusting a fixed size.
Note: this script draws the QR code onto its own blank PDF page — it does not composite it onto your background photo for you. To combine the two, either draw your background image onto the same canvas before calling draw_qr() (with pdf.drawImage()), or merge the two as separate PDF pages using pypdf, the actively maintained successor to PyPDF2 (PyPDF2 itself was deprecated in December 2022, so I have dropped its unused import from the snippet above).
You can use your own QR code size and its offsets relative to your background image. Check What are the different iOS Wallpaper sizes? for size information. Have fun!
Conclusion: A Python QR-Code Wallpaper
You now have a simple iPhone wallpaper with an embedded QR code, built in a few lines of Python using reportlab.
iPhone QR-Code Wallpaper FAQ
Which Python library generates a QR code for an image?
This tutorial uses reportlab (from reportlab.graphics.barcode import qr), which draws a QrCodeWidget onto a canvas. Install it with pip install reportlab.
How do I add a QR code to an iPhone wallpaper?
Create or pick a background image, generate the QR code with reportlab sized and offset to sit over the background, then on the iPhone open the image, tap Share, and choose “Use as Wallpaper”.
What resolution should an iPhone wallpaper be?
It depends on the device — the example targets iPhone 12 at 1170x2532 px, its official resolution. Check the per-model dimensions in the linked iOS wallpaper-sizes reference before exporting.
Did you like this post? Please let me know if you have any comments or suggestions.
Python posts that might be interesting for youRelated tools you may want to try next.
Mixo.io generates websites instantly using AI. Builds stunning landing pages without any code or design. Includes a built-in email waiting list and all the tools you need to launch, grow, and test your ideas.
References
1. What are the different iOS Wallpaper sizes?
3. iPhone 12 - Technical Specifications (Apple Support)
Stay Ahead in AI, Machine Learning & Python
No hype. Weekly notes on AI tools, Python, and what I'm actually building — plus two free gifts: the 15-page Fantastic AI: The 2026 Toolkit and a Git Commands & Contribution Workflow Cheatsheet.
You're in
Check your inbox for Set a password to unlock articles if you want gated tutorials. Log in with the same email.