Every post here needs the same thing done to a handful of files: resize the long edge, sharpen slightly, strip the location data, and write out a copy that is safe to upload. I used to do this by hand and now I do not.
This is not clever and it is not mine originally. It is just the line I have ended up running most often, kept here mostly so I can find it again.
mogrify -path ./web \
-resize 1600x1600\> \
-strip \
-quality 82 \
-unsharp 0x0.75+0.75+0.008 \
*.jpg
What each part is for
-resize 1600x1600>only shrinks. The trailing marker stops it enlarging anything already smaller.-stripremoves the metadata, which includes where the photograph was taken. This matters more than people think.-quality 82is about the point where I stop being able to tell, on these kinds of images.-unsharpputs back a little of what the resize took away. The numbers are conservative on purpose.
The ./web folder has to exist first, otherwise the command fails with a message that is technically accurate and no help at all. Ask me how I know.
Everything about this is a matter of taste except stripping the metadata, which I would argue is simply good manners when you are posting photographs of places you have been.

Leave a Reply