convert-to-avif
Skill21 starsChanged 9 days agoMITView on GitHub
Use when the user wants AVIF output — modern web format with ~30% better compression than WebP at the same visual quality, and ~50% better than JPEG. Wraps `avifenc`. Companion to `convert-to-webp`. Best target for new web work; check browser support if delivering to ancient clients.
In this repository28 other files it gives its agents.
- ai-graphicsSkill
- auto-deskewSkill
- auto-toneSkill
- auto-white-balanceSkill
- batch-set-copyrightSkill
- check-model-pricingSkill
- fast-resizeSkill
- 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
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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 when:
- Very specific: line 34
Verify avifenc is on PATH.
- Very specific: line 46
If --keep-exif was set, post-process:
≈ “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
Convert to AVIF
Encode JPEG/PNG/TIFF to AVIF. AVIF beats WebP on compression ratio and supports 10/12-bit, HDR, and lossless modes. Browser support is universal as of 2024 (Chrome 85+, Firefox 113+, Safari 16.4+).
When to use
- Web-prep where modern browser support is fine.
- Archival of high-bit-depth photos (10/12-bit AVIF preserves more than JPEG).
- Pre-step inside
web-readyorchestrator.
Do not use this skill when:
- Output must work in Safari <16.4 / IE / very old Android browsers — fall back to WebP or JPEG.
- Source is already AVIF — no point re-encoding.
- You need lossless re-encoding of a JPEG that should remain bit-exact-decodable — that's
convert-to-jxl's unique trick, not AVIF's.
Inputs
- Input — file or directory. Required.
- Quality —
avifenc -q N(0–100). Default60(visually equivalent to JPEG q82, much smaller).80for archival;45for aggressive. - Speed/effort —
avifenc -s <0..10>. Default6(balanced).0is best compression but very slow;10is fast but bigger files. - Lossless —
--lossless. Enables lossless mode (ignores quality). For exact archival of PNG. - Bit depth —
--depth 8|10|12. Default8. Use10for HDR or 16-bit source. - Output dir — default:
<input-dir>/avif/. Skill never overwrites originals. - Recursive —
--recursivefor directory descent. - Preserve EXIF — default off (web-prep assumption).
--keep-exifto copy EXIF over viaexiftool.
Procedure
- Verify
avifencis on PATH. If missing, point atinstall-deps. - Enumerate inputs (jpg, jpeg, png, tiff — skip others with note).
For each file:
avifenc -q <quality> -s <speed> [--lossless] [--depth <n>] "<input>" "<output>"Per-file. avifenc is single-threaded per encode but accepts
--jobs Nfor tile-parallel — useful on large images. For batch parallelism, usexargs -P <ncpu>.If
--keep-exifwas set, post-process:exiftool -tagsfromfile "<input>" -all:all "<output>" -overwrite_original- Track size deltas.
Output
- AVIF files at
<output-dir>/. - Summary:
- Files processed / failed.
- Total:
<orig-MB>→<new-MB>(<pct>%saved). - Quality estimate per file (using
--qcolorif requested).
Notes
- AVIF encoding is slow compared to JPEG/WebP. Speed
6is ~2–4× slower thancwebp. Speed0can be 30× slower. Pick6unless archiving. --speed 6 --quality 60is the de facto web-prep default — quality matches q82 JPEG at roughly half the bytes.- Animation: avifenc supports animated AVIF from PNG sequences (
avifenc -i input1.png -i input2.png ...) but this skill focuses on still images. - Decode support outside browsers is uneven (older image viewers may not decode). Check before mass-converting an archive.
- For guaranteed lossless re-encode of a JPEG (bit-exact reversible), use
convert-to-jxlinstead — JXL has a unique lossless-JPEG mode.
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.

