Guide · Designers and developers

Batch resize images

Resize a folder with a predictable output directory, an inspectable plan, and isolated results.

When every asset needs the same maximum dimension, use the CLI shorthand or a preset. A folder input is discovered and planned file by file.

Plan first

Terminal window
rastry ./assets --to webp --max-width 1600 --output ./optimized --dry-run

This creates a proportional resize with contain, converts to WebP, and strips metadata. It does not write to optimized/ while planning.

Execute the reviewed batch

Terminal window
rastry ./assets --to webp --max-width 1600 --output ./optimized --execute

The summary reports each file and totals for processed, skipped, failed, and cancelled results. A bad input does not erase the successful results of its neighbors.

For a fixed square product canvas, use the ecommerce preset. For a centered square crop, use the social preset and check the crop against the subject.

More from Rastry

Open the related documentation