😫 Vấn đề (The Pain Point)
Bạn tổ chức sự kiện/đám cưới với 500 khách mời. Bạn có file thiết kế thiệp đẹp lung linh, nhưng giờ phải ngồi điền tên từng người vào thiệp để gửi online?
Cách làm thủ công:
- Mở Photoshop/Canva.
- Sửa layer Text thành tên “Nguyễn Văn A”.
- Export ảnh “Thiep_NguyenVanA.jpg”.
- Sửa tiếp thành “Trần Thị B”…
- Lặp lại 500 lần.
Vừa lâu, vừa dễ sai chính tả, vừa mỏi tay!
🚀 Giải pháp Agentic (The Solution)
Bạn sẽ có một Web Tool (Chạy Local) cho phép bạn upload mẫu thiệp, chỉnh font chữ, kéo thả vị trí tên khách, và bấm nút để in hàng loạt.
Tính năng:
- Visual Configurator: Giao diện web (HTML) giúp bạn upload ảnh thiệp và kéo thả chữ “Tên Khách” đến đúng chỗ.
- Google Fonts: Hỗ trợ chọn font chữ đẹp, nghệ thuật.
- Bulk Generate: Đọc danh sách tên từ file text/csv và tạo ra 500 ảnh trong nháy mắt.
- High Quality: Xuất ảnh độ phân giải cao, rõ nét.
(Giao diện cấu hình trực quan trên trình duyệt)
🤖 Engineering Prompt (Copy & Paste)
Copy đoạn prompt này để tạo công cụ:
**Role:** Full-stack Web & Python Developer
**Task:** Create a local "Invitation Maker" workflow that allows users to bulk-generate personalized event invitations.
**Requirements:**
1. **Workflow Architecture:**
* **Frontend (Configuration):** An HTML5/JS interface to visual setup the invitation layout.
* Upload a template image.
* Drag and drop a placeholder text ("Customer Name") to position it.
* Select fonts (support Google Fonts).
* Adjust font size, color, and alignment.
* **Export:** Save the configuration to a `config.json` file.
* **Backend (Processing):** A Python script (`process.py`) that:
* Reads `config.json` and a list of names (e.g., `guests.csv` or `names.txt`).
* Uses `PIL` (Pillow) to draw the text onto the template image for each name.
* Saves the output images to an `output` folder.
2. **Key Features:**
* **Real-time Preview:** The HTML tool must show exactly how the text looks on the image.
* **Google Fonts Support:** Allow users to type a font name or select from a preset.
* **High Quality:** Ensure text rendering is anti-aliased and high resolution.
3. **Deliverables:**
* `setup_invitation.html`: The configuration editor.
* `process.py`: The batch generator script.
* `requirements.txt`: Dependencies (Pillow, etc.).
* `run.bat`: Launcher script.
**Context:** Used for printing 500+ personalized wedding or event invitations.
🧠 Giải mã Prompt (Anatomy)
- Hybrid Architecture: Tại sao lại dùng HTML cho bước Setup? Vì trình duyệt web hỗ trợ chọn font (Google Fonts) và hiển thị preview văn bản tốt hơn, đẹp hơn
tkinter. - Backend Python: Tại sao dùng Python xử lý ảnh? Vì Python (
Pillow) xử lý ảnh hàng loạt nhanh và ổn định hơn JavaScript trình duyệt. - JSON Bridge: File
config.jsonđóng vai trò cầu nối giữa Frontend (HTML) và Backend (Python).
🛠️ Hướng dẫn sử dụng (Zero-Touch Guide)
- Copy Prompt ở trên và paste vào AI.
- Chạy file
run.bat(AI sẽ tạo file này để cài thư viện Python). - Mở file
setup_invitation.htmlbằng trình duyệt (Chrome/Edge).- Upload ảnh thiệp mời gốc (chưa có tên).
- Kéo chữ “Tên Khách” vào vị trí mong muốn.
- Chọn Font, Màu, Size.
- Bấm Download Config để lưu file
config.jsonvào thư mục dự án.
- Tạo file
names.txtchứa danh sách khách mời (mỗi tên 1 dòng). - Chạy lại
run.bat(hoặcprocess.py) để sinh ảnh.
Toàn bộ thiệp mời đã nằm trong folder output!