From image-production
Losslessly transcode JPEG files to JPEG XL, preserving the original JPEG bitstream while achieving ~20% file size reduction. Use when archiving JPEG photo libraries where the goal is smaller files without re-compression artifacts.
npx claudepluginhub danielrosehill/claude-code-plugins --plugin image-productionThis skill is limited to using the following tools:
Walk a directory of JPEG files and convert them to JPEG XL (.jxl) format using lossless encoding. `cjxl` automatically detects JPEG bitstream and preserves it without re-compression. Reports byte savings; explains how to recover the original JPEG if needed.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
Walk a directory of JPEG files and convert them to JPEG XL (.jxl) format using lossless encoding. cjxl automatically detects JPEG bitstream and preserves it without re-compression. Reports byte savings; explains how to recover the original JPEG if needed.
djxl --jpeg..jpg or .jpeg). Default: current directory..jxl files sit alongside .jpg).command -v cjxl || echo "cjxl not installed — install with: sudo apt install libjxl-tools"
Abort if missing.
Show the user what will happen:
# Count JPEGs in scope
find <target> -maxdepth <1|999> -type f \
\( -iname '*.jpg' -o -iname '*.jpeg' \) | tee /tmp/jpegs.txt | wc -l
# Estimate original size
find <target> -maxdepth <1|999> -type f \
\( -iname '*.jpg' -o -iname '*.jpeg' \) -exec du -ch {} + | tail -1
Print:
Use -d 0 (lossless) and a reasonable effort (suggest 6–7 for balance):
Folder (non-recursive):
find <target> -maxdepth 1 -type f \
\( -iname '*.jpg' -o -iname '*.jpeg' \) \
-exec cjxl -d 0 -e 7 {} {.}.jxl \;
Recursive:
find <target> -maxdepth 999 -type f \
\( -iname '*.jpg' -o -iname '*.jpeg' \) \
-exec cjxl -d 0 -e 7 {} {.}.jxl \;
(The -d 0 flag ensures lossless encoding. Effort 7 balances speed and compression. Effort 9 is slower but slightly smaller; only recommend if the user has time.)
After transcoding:
# Count JXL files created
find <target> -maxdepth <1|999> -type f -iname '*.jxl' | wc -l
# Total size of JXL files
find <target> -maxdepth <1|999> -type f -iname '*.jxl' -exec du -ch {} + | tail -1
# Bytes saved (original size - new size)
du -ch <target> | tail -1
Print:
Inform the user:
If you ever need to recover the original JPEG bitstream byte-exact (for legal/archival purposes), run:
djxl --jpeg archive.jxl recovered.jpgThis works because
cjxldetected and preserved the original JPEG structure.
.jxl files created in the source directory (or user-specified output folder)..jpg files remain untouched.cjxl auto-detects JPEG bitstreams and preserves them exactly. This is why djxl --jpeg can recover the original — it's not a re-encoded approximation.-size +100k for files larger than 100 KB).apt install libjxl-tools.