Batch Resize Images In Place with ImageMagick mogrify
Apply the same resize, format conversion, or quality change to every matching image in a directory with a single command.
Run mogrify -resize 1600x -path ./resized *.jpg to scale every JPEG to 1600 px wide and write the results into ./resized.
01Command
Command
$ mogrify -resize 1600x -path ./resized *.jpg02What it does
mogrify is ImageMagick's batch tool: unlike convert, it overwrites or writes files for every input in one shot, so there's no shell loop needed. -path ./resized directs the output to a separate directory, and -resize 1600x scales to 1600 px wide while preserving aspect ratio. It also handles format conversion (-format webp) and recompression (-quality 82) across the same file set.
03Risk
!Warning: Without -path, mogrify overwrites the originals in place — always use -path or keep backups before batch-processing your only copies.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- ImageMagick mogrify Command DocumentationEvidence: Official mogrify reference: 'resize, blur, crop, ... in place' including the -path option to write output to a different directory.
Last verified: 2026-09-17 · Category: Media