Resizing one image is easy anywhere. Resizing four hundred of them — product shots, a photo dump, screenshots for docs — is where a clicky tool falls apart and an online “bulk resizer” wants you to upload the lot. ImageMagick in WSL does the whole folder in one line, for free, without a single file leaving your machine.
The one thing to get right is which command you use: mogrify is fast but overwrites originals, while magick/convert is safer because it writes new files. This guide covers both, plus the resize syntax that controls exactly what happens.
No WSL yet? See the WSL install guide.
Install ImageMagick
sudo apt update && sudo apt install -y imagemagick
Check it:
magick -version
On older versions the command is convert and the batch tool is mogrify; both are part of ImageMagick.
The resize syntax (the part that matters)
ImageMagick’s -resize takes a geometry string. Getting this right is most of the job:
-resize geometry operators
| 800x600 | Fit inside 800x600, keep aspect ratio |
|---|---|
| 800x | Width 800, height scales to match |
| x600 | Height 600, width scales to match |
| 50% | Scale to 50% of original |
| 800x600! | Force exact size (may distort) |
| 1600x1600> | Only shrink images larger than this |
| 800x600^ | Fill the box, then you can crop |
The two you’ll use most are a single dimension (keeps the ratio) and the > operator (only shrinks, never upscales).
Safe batch resize (writes new files)
This keeps your originals. It resizes every JPG in the current folder to 800px wide and writes the result into a resized subfolder:
mkdir -p resized
for f in *.jpg; do magick "$f" -resize 800x "resized/$f"; done
Because each output goes to resized/, your source files are never touched. Swap 800x for any geometry from the table — 50%, x600, 1600x1600>, and so on.
Fast in-place batch with mogrify
mogrify is built for exactly this and doesn’t need a loop — but it overwrites the originals, so work on a copy:
cp -r originals/ work/ && cd work/
mogrify -resize 1600x1600> *.jpg
That resizes every JPG larger than 1600×1600 down to fit, and leaves smaller ones alone — ideal for taming a folder of oversized photos in one pass.
Resize and convert at the same time
mogrify can change format while resizing. To resize and output WebP in one step:
mogrify -path resized -format webp -resize 1200x *.jpg
-path resized sends output to that folder (create it first), and -format webp writes .webp files — so this also leaves your JPGs intact. To go further with WebP, see convert JPG to WebP.
A practical web-image workflow
For a folder of camera photos you want web-ready — capped size and stripped metadata:
mkdir -p web
for f in *.jpg *.jpeg; do [ -e "$f" ] && magick "$f" -resize 1600x1600> -strip -quality 85 "web/${f%.*}.jpg"; done
-resize 1600x1600>caps dimensions without upscaling.-stripremoves metadata (smaller file, and clears GPS — see remove image metadata).-quality 85keeps photos clean at a smaller size.- Output lands in
web/, originals untouched.
Wrapping up
Batch resizing on Windows is one ImageMagick line away. Use a magick loop into a separate folder when you want your originals safe, or mogrify (on a copy) when you want the fastest in-place pass. The geometry string does the work: a single dimension keeps the ratio, and > shrinks without upscaling.
It’s free, it clears whole folders at once, and it all runs in WSL — so nothing gets uploaded. Pair it with stripping and quality settings and you’ve got a repeatable web-image pipeline in a single command.