π« The Pain Point
Shopee/Lazada requires all images to be 1:1 Square. And you want your shop logo in the corner to prevent theft. Doing 2 steps (Crop + Stamp) for 100 products = 200 actions.
π Agentic Solution
The Pipeline: Chains multiple image operations into one command.
Key Features:
- Padding: If image is rectangular, it adds white padding to make it square (instead of cropping content).
- Positioning: Logo is placed 20px from the bottom-right corner automatically.
βοΈ Phase 1: Commander (Quick Fix)
For a new product launch.
Prompt:
βI have a folder of product photos. 1. Resize them to fit within 1000x1000 px, adding white padding to make them perfect squares. 2. Paste
logo.pngin the bottom-right corner. Save to βProcessedβ.β
Result: Shop-ready photos.
ποΈ Phase 2: Architect (Permanent Tool)
For Shop Owners.
Engineering Prompt:
**Role:** Python Content Pipeline Dev
**Task:** Create an "E-commerce Image Processor".
**Requirements:**
1. **GUI:**
* Select Input Folder.
* Select Logo File.
* Input: Target Size (Default 1000).
* Position: Top-Left, Bottom-Right, etc.
* "Run Batch" button.
2. **Logic:**
* **Step 1 (Square):** Create new white image (1000x1000). Paste resized photo in center.
* **Step 2 (Watermark):** Calculate coordinates (Width - LogoWidth - Margin). Paste alpha composite.
3. **Deliverables:** `shop_images.py`, `run.bat` (Windows), `run.sh` (Mac).
π§ Prompt Decoding
- Square Padding: This is E-commerce 101. If you simple force resize a 4:3 photo to 1:1, it stretches. The βPaddingβ logic preserves the aspect ratio while meeting platform requirements.
π οΈ Instructions
- Copy Prompt -> Paste -> Run.
- Select Photos -> Select Logo -> Run.