All Skills

Origin

Native to the tool I'm already in.

I record demo videos with Screen Studio pretty regularly, either for posting on socials or sending to colleagues. They come out high-quality, which means they come out huge. So the flow was always the same: drag the file into one of those free converter.com sites, wait, download, find the output, share. Five clicks of friction around 30 seconds of work.

Same shape with AI images. I generate and upscale a lot, the files come out massive, and the workflow was the same converter sites with the same friction.

I tried the existing Raycast options and none of them landed. And I’m in Raycast all day, so making my own made sense. What I built is steerable: per file or batch, you pick a quality preset, a format, and the encoder flags, and the compression runs in the background. The video optimization is tight. A 898 MB screen recording I shared compressed to 25.5 MB (97% smaller) on h265 in under two minutes.

Commands

Five commands, one pipeline.

The compression logic is shared. The commands are different ways to reach it depending on how much you want to think about it.

Mode 01

Quick Compress

No-view command. Select files in Finder, fire it, get a HUD when it's done. Defaults to "high" quality (visually identical to the original for most images, 50-70% smaller for video). Handles images and videos in the same selection. Images run inline in Raycast. Videos detach to a native Swift overlay so the Raycast window can close.

Quick Compress (no-view)
Mode 02

Compress Media

The full form. Image quality preset, video codec (H.264, H.265, AV1), encode speed, resolution downscale, audio mode (smart copy or re-encode), and three ways to size video output: by quality (CRF), by percent of original, or by exact target MB. The percent and target-size modes use two-pass encoding. Use this when you want full control over the output.

Compress Media (form)
Mode 03

Compress Folder

Pick a folder, pick a quality preset, get a results table. Compresses every image at the folder's top level and shows a markdown summary with per-file before/after sizes and total bytes saved. Useful for the "I have 200 PNGs from a screenshot session" case.

Compress Folder (form + results)
Mode 04

Manage Watch Folders

Add or remove folders that auto-compress new images. Each folder has its own quality preset. Adding the first folder installs a launchd LaunchAgent and a bash watch script under ~/.config/media-compressor/. Removing the last one tears it down. An xattr marker on each compressed file means re-runs skip what's already been processed.

Manage Watch Folders (list)
Mode 05

Install Compression Tools

One-time setup. Installs pngquant, oxipng, jpegoptim, and ffmpeg via Homebrew, then compiles the Swift progress overlay to ~/.config/media-compressor/compress-overlay. The other commands check for the tools they need and prompt this if anything's missing.

Install Compression Tools (no-view)

Install

Why it's a local dev install.

This would have shipped to the Raycast Store, but the store doesn’t allow background launchd LaunchAgents, which is what watch folders run on. Cutting watch folders to fit the store would have gutted a big part of why this exists. So it lives in the repo, installed as a local dev extension.

$git clone https://github.com/kylezantos/media-compressor-raycast.git$cd media-compressor-raycast$npm install$npm run dev#Raycast picks it up automatically. Once it appears, you can stop dev (it stays installed).

First launch, run “Install Compression Tools” to pull the Homebrew binaries and compile the Swift overlay.

Requires macOS, Raycast, Homebrew, and Node.

View on GitHub

How It Works

Native processes, shared pipeline.

Images go through pngquant for lossy quantization (skipped on lossless), then oxipng for lossless optimization. JPEGs use jpegoptim with a quality cap. Both write to a temp file first and only replace the original if the new file comes out smaller. Originals go to the Trash (recoverable, since I trust this but not that much). Files get an xattr tag so re-runs and the watch daemon both know to skip them.

Videos hand off to a detached process. Raycast spawns a Swift overlay binary with a config file, then closes. The overlay shows a native floating progress window, runs ffmpeg with the right codec and pass count, and moves the result into place when it’s done. That’s why videos can compress while you go back to whatever you were doing in Raycast or anywhere else.

Watch folders use launchd’s WatchPaths, which fires the bash script whenever the folder contents change. The script reads the same watcher config the Raycast UI writes to, so the two sides stay in sync without a running daemon process.