fast-resize
Skill21 starsChanged 7 days agoMITView on GitHub
Use when the user wants to resize a large batch of images (>500 files) where ImageMagick throughput is the bottleneck. Wraps libvips for 5–10× faster batch resize at lower memory. Falls back to ImageMagick if `vips` isn't installed. Same outputs as `batch-resize` — different engine.
In this repository28 other files it gives its agents.
- ai-graphicsSkill
- auto-deskewSkill
- auto-toneSkill
- auto-white-balanceSkill
- batch-set-copyrightSkill
- check-model-pricingSkill
- convert-to-avifSkill
- fast-thumbnailSkill
- from-jxlSkill
- images-to-pdfSkill
- install-depsSkill
- new-projectSkill
- new-workflowSkill
- open-workspaceSkill
- optimize-jpegSkill
- optimize-pngSkill
- pdf-extract-embedded-imagesSkill
- pdf-to-imagesSkill
- read-metadataSkill
- scrub-metadataSkill
- set-metadataSkill
- svg-to-rasterSkill
- to-jxlSkill
- transcode-jpeg-to-jxl-losslessSkill
- upscale-imageSkill
- vectorizeSkill
- web-readySkill
- workspace-setupSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Do not use this skill for:
- Very specific: line 35
Verify vips is on PATH. If missing, fall back to ImageMagick convert with the same parameters and warn that this will be slower (point at …
- Distinctive: line 55
Run in parallel where safe.
- Very specific: line 64
If output-dir was used and any source files had identical names from different subdirectories without --recursive flattening logic, flag …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fast Resize (libvips)
Batch image resize using libvips. Material throughput improvement over ImageMagick on large libraries — typical 5–10× speed-up and lower peak memory.
When to use
- Batch is >500 images.
- The user is feeling ImageMagick's slowness (or is about to).
- The job is "resize this directory" — pure resize without compositing or filters.
Do not use this skill for:
- Small batches (<100 images) —
batch-resizeis fine, no point swapping engines. - Resize-with-filter / resize-with-text / multi-op pipelines — ImageMagick is the better tool for compound work.
Inputs
- Input directory — required.
- Target size — one of:
--width N— resize so width = N, height auto.--height N— resize so height = N, width auto.--max NxM— fit within NxM box (preserves aspect).--exact NxM— force exact dimensions (may distort or crop).
- Output mode —
in-place(overwrite) or--output-dir <path>(default:<input>/resized/). - Filter — interpolation kernel:
lanczos3(default — best quality),cubic,linear,nearest. - Recursive —
--recursiveto descend into subdirectories. Default: top-level only. - Format preserve — by default keeps source format.
--to <ext>to change format on the way out.
Procedure
- Verify
vipsis on PATH. If missing, fall back to ImageMagickconvertwith the same parameters and warn that this will be slower (point atinstall-deps). - Enumerate input files (filter to image extensions: jpg, jpeg, png, webp, tiff, gif, heic, avif, jxl).
For each file, build the vips command. Two main forms:
Fit within box (preserves aspect):
vipsthumbnail "<input>" --size "<W>x<H>" --output "<output>[Q=85]"vipsthumbnailis the right tool for "resize down" — it's optimised for thumbnail-style ops and handles JPEG shrink-on-load (free 8× speedup for 1/8-size targets).Exact resize via
vips:vips resize "<input>" "<output>" <scale-factor> --kernel <kernel>For
--width/--height, compute scale = target / source.vipsthumbnailis preferred when shrinking; usevips resizewhen upscaling or when source dimensions vary widely.- Run in parallel where safe. vips is internally threaded; running multiple processes via xargs/parallel adds little. One process per CPU core is the sweet spot for large batches.
- Report progress every N files (every 10% or every 100, whichever is more frequent).
Output
- Resized images at the resolved output paths.
- Summary:
<n> files processed, <total-input-MB>MB → <total-output-MB>MB, <elapsed-s>s, avg <ms>ms/image. - List of any files that failed (corrupt, unsupported format, permission errors).
- If output-dir was used and any source files had identical names from different subdirectories without
--recursiveflattening logic, flag the collision.
Notes
vipsthumbnailaccepts[Q=N]syntax for JPEG quality on output (default 75; 85 is a good balance).- Wide colour gamut: vips preserves ICC profiles by default. If the user is processing display-P3 / Adobe RGB images, that's a feature.
- HEIC / AVIF / JXL: vips supports these if compiled with the right libs (apt's
libvips-toolsincludes libheif and libjxl on recent Ubuntu). - ImageMagick fallback path: if
vipsis missing, runconvert "<input>" -resize <WxH> "<output>"per file. Same output, slower.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

