Opening files one by one in a GUI is fine for a handful of images. When you have 200 product photos that need converting to WebP, or an archive of TIFFs that need JPEG versions, clicking is a trap. ImageMagick’s magick mogrify turns a folder’s worth of work into a single line:
magick mogrify -format webp -quality 82 -path ./output *.jpgThe -path flag is non-negotiable. Without it, mogrify overwrites your originals in place. Always write to a separate output folder and keep sources intact.
Need to resize at the same time? Chain the options — the \> modifier means "only shrink, never enlarge", a sensible default for web images:
magick mogrify -format webp -quality 82 -resize 1600x1600\> -path ./output *.jpgFor PNG-to-AVIF, swap -format avif and drop quality to 60–70 — AVIF’s encoder is more aggressive, so the same number produces a smaller file. It’s also slower, so budget the time or parallelise with xargs or GNU parallel.