A minimalist, single-page web utility that accepts any human portrait photo and instantly generates a print-ready A4 sheet of standard Indian passport photos.
- Face Detection & Alignment: Automatically aligns crooked photos using eye detection.
- AI Background Removal: Clears out any existing background.
- Auto-Formatting: Replaces background with pure white and intelligently crops to exact passport proportions (35×45mm).
- Print-Ready Layout: Generates an A4 PDF sheet with 8 perfectly spaced photos.
- Client-Side Privacy: Processes entirely locally (no images stored).
- Frontend: React, Vite, Tailwind CSS
- Backend: Python 3, Flask, OpenCV (CV2),
rembg(Background removal), ReportLab (PDF)
Navigate to the backend folder, set up a virtual environment, and install requirements:
cd backend
python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate
pip install -r requirements.txt
python app.pyBackend runs on http://localhost:5000
Open a new terminal, navigate to the frontend folder, install packages, and start Vite:
cd frontend
npm install
npm run devFrontend runs on http://localhost:5173
- Open the frontend in your browser.
- Drag and drop any JPG or PNG containing a human face.
- Wait a few seconds for processing (the very first run may take slightly longer to load the AI model into memory).
- Download your passport photo as a PNG or your ready-to-print A4 PDF sheet!