😫 Vấn đề (The Pain Point)
Bạn muốn profile Instagram trông thật nghệ thuật với một bức ảnh khổng lồ được ghép từ 9 post nhỏ.
Cách làm thủ công: Dùng tool crop, canh bằng mắt, cắt từng cái, dễ bị lệch pixel dẫn đến khi ghép lại không khớp.
🚀 Giải pháp Agentic (The Solution)
Tool tự động chia cắt ảnh chính xác đến từng pixel, và đánh số thứ tự để bạn đăng đúng trình tự.
Tính năng:
- Flexible Grid: Chọn 3x1, 3x2, 3x3, 3x4…
- Auto Numbering: Tên file được đánh số
01.jpg,02.jpg… theo đúng thứ tự cần upload (thường là từ dưới lên phải qua trái cho Instagram). - Preview: Xem các đường cắt trước khi xuất.
🤖 Engineering Prompt (Copy & Paste)
**Role:** Python Tool Developer
**Task:** Create an "Image Grid Splitter" app for Instagram/Social Media.
**Requirements:**
1. **Tech Stack:** Python, `tkinter`, `Pillow`.
2. **GUI:**
* Upload Image button (Select single file).
* Grid Configuration: Columns (default 3), Rows (default 3).
* Preview Canvas: Show the image with grid lines overlay.
* "Split & Save" button.
3. **Logic:**
* Calculate tile size based on image W/H and Rows/Cols.
* Crop image into tiles.
* **Filename Logic (Crucial):** Save tiles as `tile_1.jpg`, `tile_2.jpg`...
* **Instagram Order:** Instagram fills from bottom-right? (Check standard). Usually simple Left->Right, Top->Bottom is fine, user uploads in reverse order. *Actually, providing a specific order guide in the UI is better.*
* Save all tiles to a new folder named `[Filename]_Grid`.
4. **Deliverables:**
* `grid_splitter.py`
* `run.bat`
* `requirements.txt`
**Context:** Social media managers want to create "Giant Square" layouts on profiles.
🧠 Giải mã Prompt
- Grid Lines Overlay: Yêu cầu vẽ đường kẻ lên ảnh preview giúp user hình dung được bố cục bức ảnh sẽ bị cắt vào đâu (ví dụ: tránh cắt ngang mặt).
- Folder Organization: Nên tạo folder riêng cho mỗi lần cắt để tránh lẫn lộn file.
🛠️ Hướng dẫn
- Copy Prompt -> AI Editor paste.
- Chạy
run.bat. - Chọn ảnh -> Chọn 3x3 -> Split.
- Vào folder kết quả lấy ảnh đi đăng.