image-resize

Resize and compress image files to target dimensions using Python with Pillow.

Updated Apr 17, 2026
One-click install
npx skills add https://github.com/xiaoli123/agentscope-core --skill image-resize-xiaoli123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: image-resize
Source: https://github.com/xiaoli123/agentscope-core/tree/main/agentscope-core/src/test/resources/e2e-skills/image-resize
Command: npx skills add https://github.com/xiaoli123/agentscope-core --skill image-resize-xiaoli123

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Pillow, and includes scripts (resource) components.

What problem does it solve?

Resizes and compresses image files to target dimensions, enabling fast preparation of images for web and mobile use.

Core Features & Use Cases

  • Batch resize images (JPEG, PNG, WebP) from a folder or individual files.
  • Preserve aspect ratio when height is omitted, or apply exact dimensions when height is provided.
  • Output resized images to a designated directory, accessible via a simple CLI.

Quick Start

Resize a batch of photos to 800px wide and save them to the resized/ directory.

Frequently Asked Questions about image-resize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I batch resize images for web use from the command line?

Batch resize images for web use by processing folders or individual files via the command line. This tool reads JPEG, PNG, and WebP files, applies target dimensions, and saves compressed results to a specified output directory.

Can I preserve aspect ratio when resizing images with Python?

Preserve aspect ratio when resizing images by omitting the height parameter; the tool calculates the proportional height automatically. Providing both width and height applies exact dimensions instead.

Does Pillow support compressing PNG and WebP files in bulk?

Pillow supports compressing PNG and WebP files in bulk by reading source directories and writing optimized images to disk. The script handles batch processing natively to prepare images for mobile platforms.

What is the best way to compress images for mobile use without losing dimensions?

Compress images for mobile use without losing dimensions by specifying a target width while omitting height to maintain the aspect ratio. This ensures the image scales proportionally without distortion.

Do I need Python to batch resize JPEG files to a specific output directory?

You need Python and the Pillow library installed to batch resize JPEG files. The script uses Pillow to process the images and write the resized outputs directly to your designated output directory.