🖼️

Chèn Watermark & Resize ảnh hàng loạt

Công cụ xử lý ảnh '2-trong-1': Đóng dấu bản quyền và chuẩn hóa kích thước ảnh sản phẩm cho sàn TMĐT.

Image ⭐ Beginner ⏱️ 5 phút

😫 Vấn đề (The Pain Point)

Bạn kinh doanh trên Shopee/Lazada. Sàn yêu cầu ảnh phải vuông (1000x1000px). Đồng thời, bạn muốn chèn Logo shop vào góc ảnh để chống bị đối thủ trộm ảnh.

Cách làm thủ công:

  1. Mở Photoshop/Canva.
  2. Tạo canvas vuông.
  3. Kéo ảnh sản phẩm vào, chỉnh kích thước.
  4. Kéo Logo vào, chỉnh độ mờ (Opacity).
  5. Lưu file.
  6. Lặp lại cho 500 sản phẩm… (Mất cả ngày!)

🚀 Giải pháp Agentic (The Solution)

Bạn sẽ sở hữu một Mini-Photoshop chuyên dụng cho việc này.

Tính năng:

  • Visual Editor: Kéo thả Logo trực tiếp trên màn hình để đặt vị trí (không cần đoán tọa độ).
  • Smart Resize: Ảnh chữ nhật sẽ tự động được thêm nền trắng (padding) để thành hình vuông, không bị cắt cúp hay méo hình.
  • Batch Processing: Xử lý 1000 ảnh trong khi bạn đi pha cà phê.
  • Config: Lưu lại cấu hình cho lần sau.

Watermark App Screenshot (Giao diện thực tế App sẽ được Python tạo ra)

🤖 Engineering Prompt (Copy & Paste)

Copy đoạn prompt này để tạo công cụ:

**Role:** Python GUI Developer

**Task:** Create a robust Desktop App for batch image processing (Resize & Watermark).

**Requirements:**
1.  **Tech Stack:** Python, `tkinter` (Modern GUI), `Pillow` (PIL) for image processing.
2.  **Core Features:**
    *   **Visual Editor:** allow users to drag-and-drop a watermark logo onto a sample image to define position.
    *   **Controls:** Sliders for Opacity (0-100%) and Logo Scale (Size).
    *   **Native File Selection:** Buttons to select "Input Folder", "Output Folder", and "Watermark File" using system dialogs (overcoming HTML browser security limitations).
    *   **Settings Persistence:** Save the configuration (paths, position, opacity) to `config.json` so the user doesn't have to re-select every time.
3.  **Processing Logic (Run Batch):**
    *   Iterate through all images in the Input Folder.
    *   Resize main image to 1000x1000px (contain/fit mode).
    *   Add white padding (canvas) to make it a perfect square if needed.
    *   Apply the watermark at the exact coordinates and opacity defined in the Visual Editor.
    *   Save to Output Folder.
4.  **Deliverables:**
    *   `setup_gui.py`: The main Tkinter application.
    *   `requirements.txt`: Dependencies.
    *   `run.bat`: Launcher.

**Context:** Used by e-commerce sellers to process hundreds of product photos for Shopee/Lazada (requiring square images + logo).

🧠 Giải mã Prompt (Anatomy)

  • Input/Output rõ ràng: Giải quyết vấn đề bảo mật của trình duyệt web (không đọc được full path) bằng cách dùng Python (native file selection).
  • Settings Persistence: Yêu cầu lưu file config.json giúp bạn không phải chọn lại folder mỗi lần mở app. Đây là tính năng của phần mềm thương mại.
  • Visual Editor: Thay vì gõ tọa độ (x=100, y=200), chúng ta yêu cầu AI làm tính năng kéo thả.

🛠️ Hướng dẫn sử dụng (Zero-Touch Guide)

  1. Copy Prompt ở trên.
  2. Paste vào AI Editor.
  3. Chạy file run.bat được tạo ra.
  4. Trên giao diện App:
    • Chọn folder ảnh gốc (Input).
    • Chọn file Logo.
    • Kéo logo vào vị trí ưng ý trên ảnh mẫu.
    • Bấm Start Processing.

Bạn đã có ngay bộ ảnh chuẩn SEO sàn TMĐT!

Workflows liên quan

Khám phá danh mục khác

📬

Get Started with Agentic Working

Subscribe to receive updates from AgenticWorking.io

📖 Free eBook Guide 📦 7 Ready-to-use Scripts 🔔 Weekly Tips

No spam, unsubscribe anytime. Join 1,000+ subscribers.