Make Any Image Web-Ready: Resize, Convert to WebP, and Strip EXIF

Introduction

An image straight from a camera or phone is too big for the web in three ways at once: too many pixels, too many kilobytes, and too much hidden metadata — including the GPS location where it was shot. This post takes one photo and makes it web-ready with aux4/image: resize it, convert it to WebP, compress it, and strip the EXIF — then wraps all four steps into a single aux4 webready command.

Install the package

aux4 aux4 pkger install aux4/image

aux4/image uses ImageMagick; the installer sets it up.

Step 1: see what you're dealing with

aux4 image info shows the format, dimensions, and file size:

aux4 image info photo.jpg
photo.jpg JPEG 2000x1500 2000x1500+0+0 8-bit sRGB 111053B 0.000u 0:00.000

2000×1500 and about 111 KB. Add --verbose true and the hidden metadata shows up — including exactly where the photo was taken:

aux4 image info photo.jpg --verbose true
  Profiles:
    Profile-exif: 240 bytes
  Properties:
    exif:GPSLatitude: 37/1,48/1,3/1
    exif:GPSLatitudeRef: N
    exif:GPSLongitude: 122/1,25/1,9/1
    exif:GPSLongitudeRef: W
    exif:Make: aux4cam
    exif:Model: WebPrep 1000

That GPS block travels with the file unless you remove it. (--verbose true prints ImageMagick's full report; the metadata shown above is the part that matters here.)

Step 2: resize to a sane width

Cap the width at 800 pixels with --size 800x — the height follows automatically to keep the aspect ratio:

aux4 image resize photo.jpg --size 800x --output resized.jpg
Resized photo.jpg to 800x -> resized.jpg
aux4 image info resized.jpg
resized.jpg JPEG 800x600 800x600+0+0 8-bit sRGB 14192B 0.000u 0:00.000

800×600 and down to ~14 KB from smaller dimensions alone.

Step 3: convert to WebP

WebP is smaller than JPEG at the same quality. aux4 image convert swaps the format; with no --output, it reuses the base name and the new extension:

aux4 image convert resized.jpg --format webp
Converted resized.jpg -> resized.webp
file resized.webp
resized.webp: RIFF (little-endian) data, Web/P image

Step 4: compress

aux4 image compress squeezes the file at a quality you choose (default 80):

aux4 image compress resized.webp --quality 80 --output out.webp
Compressed resized.webp (quality: 80) -> out.webp
ls -la resized.webp out.webp
-rw-r--r--  1 you  staff  3638 resized.webp
-rw-r--r--  1 you  staff  2376 out.webp

3638 → 2376 bytes, roughly a third smaller.

Step 5: strip the EXIF (and the GPS)

Resizing and converting keep the EXIF — the GPS coordinates are still riding along. aux4 image strip removes all of it:

aux4 image strip out.webp --output clean.webp
Stripped metadata from out.webp -> clean.webp

Check again, and the EXIF profile and GPS block are gone:

aux4 image info clean.webp --verbose true
  Properties:
    date:create: 2026-07-25T09:41:00+00:00
    date:modify: 2026-07-25T09:41:00+00:00
    signature: 4c3f...e12

No Profile-exif, no exif:GPSLatitude — the location no longer ships with the image.

Step 6: one command for the whole pipeline

Chain all four steps into an aux4 webready command so a teammate runs one line per image. Drop this in a local .aux4 file:

{
  "profiles": [
    {
      "name": "main",
      "commands": [
        {
          "name": "webready",
          "execute": [
            "set:name=!echo value(input) | sed 's/\\.[^.]*$//'",
            "aux4 image resize ${input} --size ${size} --output ${name}.tmp.jpg",
            "aux4 image convert ${name}.tmp.jpg --format webp --output ${name}.web.webp",
            "aux4 image compress ${name}.web.webp --quality ${quality} --output ${name}.web.webp",
            "aux4 image strip ${name}.web.webp",
            "nout:rm -f ${name}.tmp.jpg",
            "log:Web-ready: ${input} -> ${name}.web.webp"
          ],
          "help": {
            "text": "Resize, convert to WebP, compress, and strip metadata for the web",
            "variables": [
              { "name": "input", "text": "Input image file", "arg": true },
              { "name": "size", "text": "Max width, e.g. 800x", "default": "800x" },
              { "name": "quality", "text": "WebP quality (1-100)", "default": "80" }
            ]
          }
        }
      ]
    }
  ]
}
aux4 webready photo.jpg
Resized photo.jpg to 800x -> photo.tmp.jpg
Converted photo.tmp.jpg -> photo.web.webp
Compressed photo.web.webp (quality: 80) -> photo.web.webp
Stripped metadata from photo.web.webp
Web-ready: photo.jpg -> photo.web.webp
aux4 image info photo.web.webp
photo.web.webp WEBP 800x600 800x600+0+0 8-bit sRGB 1888B 0.000u 0:00.000

From a 111 KB, GPS-tagged, 2000-pixel photo to a 1.9 KB WebP with no metadata — in one command.

Conclusion

Web-ready images without a photo editor: aux4 image resize caps the dimensions, convert moves to WebP, compress trims the bytes, and strip removes the EXIF so a page loads fast and a photo's GPS location doesn't leak. Bundled as aux4 webready, it's one command you can run over every image before it goes live.

See Also