πŸ–ΌοΈ

Batch Resize Images

Resize massive amounts of images to a specific dimension or percentage while maintaining aspect ratio.

Image ⭐ Beginner ⏱️ 3 minutes

😫 The Pain Point

You have 500 photos from a DSLR camera (20MB each, 6000px resolution). You need to upload them to a website that only accepts photos under 2000px. Opening Photoshop -> Image Size… 500 times is impossible.

πŸš€ Agentic Solution

A Batch Resizer: β€œMake everything 1920px wide” in one click.

Key Features:

  • Aspect Ratio Lock: Resizes width to 1920px and automatically calculates height to prevent squashed images.
  • Format Conversion: Can simultaneously convert PNG to JPG to save space.

βš”οΈ Phase 1: Commander (Quick Fix)

For a quick resize job.

Prompt:

β€œResize all images in the current folder to a maximum width of 1920px. Keep the aspect ratio. Save them to a new folder named β€˜Resized’ to avoid checking original files.”

Result: A folder of web-ready images.

πŸ—οΈ Phase 2: Architect (Permanent Tool)

For Photographers/Web Admins.

Engineering Prompt:

**Role:** Python Tool Developer
**Task:** Create a "Universal Image Resizer".
**Requirements:**
1.  **GUI:**
    *   Select Source Folder.
    *   Input: Max Width (e.g., 1920) OR Max Height.
    *   Quality Slider (1-100).
    *   "Process" button.
2.  **Logic:**
    *   Use `Pillow` (PIL).
    *   `img.thumbnail((width, height))` is the safest method to maintain aspect ratio.
    *   Show a progress bar.
3.  **Deliverables:** `batch_resize.py`, `run.bat` (Windows), `run.sh` (Mac).

🧠 Prompt Decoding

  • Thumbnail Method: The thumbnail() function in Pillow is smarter than resize(). It automatically calculates the correct dimensions to fit within your box without distorting the image.

πŸ› οΈ Instructions

  1. Copy Prompt -> Paste -> Run.
  2. Input 1920 -> Process.

Related Workflows

Explore other categories

πŸ“¬

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.