Resizing sounds like it should be one number, and then you find out it is two numbers that have to agree, and that going up is not the same operation as going down.
macOS has a resizer built in, no install required. -Z fits the image inside a
box on its longest edge, keeping the aspect ratio:
sips -Z 1200 photo.jpg --out photo-small.jpg
With ImageMagick, on any platform:
magick photo.jpg -resize '1200x1200>' photo-small.jpg
The > inside the quotes means "only if it is bigger" — so running it over a folder never
accidentally enlarges the small ones.
Keep the ratio, or accept the squash
An image has an aspect ratio, and if you set width and height independently you will break it. A 4000 × 3000 photo (4:3) forced into a 1200 × 1200 square comes out visibly squashed.
The fix is to fix one dimension and let the other follow:
new height = original height × (new width ÷ original width)
3000 × (1200 ÷ 4000) = 900
So 4000 × 3000 becomes 1200 × 900. Every command and tool on this page does that arithmetic for you — it is worth understanding only so you recognise the result when a tool gets it wrong.
If you genuinely need a square from a rectangle, you want to crop, not resize. Cropping discards the parts that do not fit; resizing distorts everything to make it fit.
Down is safe, up is not
Downscaling discards pixels. The resampler averages neighbouring pixels into one, which is a well-defined operation with a good answer, and the result looks correct.
Upscaling has no extra detail to work with, so it invents pixels by interpolating between the ones it has. That reads as softness. Doubling is sometimes acceptable; quadrupling looks like what it is.
Keep the full-size file. Making a 400px thumbnail from an 800px copy that was itself made from the 4000px original stacks the softening. Going back to the original costs nothing and looks better.
Sizes that are actually useful
| Use | Long edge |
|---|---|
| Thumbnail | 300–400px |
| Blog image, in the text column | 1200–1600px |
| Full-width hero | 2000px |
| Print, at 300 DPI | width in inches × 300 |
Web sizes assume high-density screens — roughly double the displayed size — which is why a 700px-wide column still wants a 1400px image.
- Work on a copy of the folder, not the originals.
- Decide the long edge from the table above, and use a "shrink only" flag so already-small files are left alone.
- Resize first, then compress — compressing before resizing wastes the effort, because the resize re-encodes anyway.
- Spot-check the smallest and the most detailed result, not just the first one.
With ImageMagick, that whole loop is one line:
magick mogrify -path ./resized -resize '1600x1600>' ./originals/*.jpg
mogrify -path writes to a different directory, which is what stops it
overwriting your source files.
Then make it smaller still
Resizing is the biggest single saving, but the file can usually go further without any visible change — that is compression, and it is a separate step.