Awesome-omni-skill image-optimizer

Optimize and compress images for web use. Reduces file sizes of JPEG, PNG, GIF images using lossy/lossless compression. Can resize images to maximum dimensions, convert to WebP format, and process entire directories recursively. Use when images are too large for web, need compression, or need format conversion.

install
source · Clone the upstream repo
git clone https://github.com/diegosouzapw/awesome-omni-skill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/content-media/image-optimizer" ~/.claude/skills/diegosouzapw-awesome-omni-skill-image-optimizer && rm -rf "$T"
manifest: skills/content-media/image-optimizer/SKILL.md
source content

Image Optimizer

Compress and optimize images for web delivery, similar to Squoosh.

Quick Start

# Ensure dependencies are installed
scripts/install-deps.sh

# Optimize images
scripts/imgopt.sh [OPTIONS] <files or directories>

Common Use Cases

Optimize a single image

scripts/imgopt.sh photo.jpg

Compress all images in a folder

scripts/imgopt.sh images/

Resize and compress for web (recommended for large images)

scripts/imgopt.sh -q 80 -w 1920 images/

Create WebP versions (best compression for modern browsers)

scripts/imgopt.sh --webp images/

Process recursively and keep originals

scripts/imgopt.sh -r --keep --webp ./website/images/

Output to a different directory

scripts/imgopt.sh -o optimized/ *.jpg *.png

Preview what would happen (dry run)

scripts/imgopt.sh -n -r images/

Options Reference

OptionDescriptionDefault
-q, --quality N
Quality level 1-10080
-w, --max-width N
Maximum width in pixelsunlimited
-h, --max-height N
Maximum height in pixelsunlimited
-o, --output DIR
Output directoryin-place
--webp
Also create WebP versionsoff
--keep
Keep originals (save as .opt.ext)off
-r, --recursive
Process directories recursivelyoff
-n, --dry-run
Show what would be doneoff
-v, --verbose
Show detailed progressoff

Supported Formats

  • Input: JPEG, PNG, GIF, BMP, TIFF
  • Output: Same format (optimized) + optional WebP

Recommended Settings by Use Case

Use CaseCommand
Blog images
-q 80 -w 1200 --webp
Hero/banner images
-q 85 -w 1920 --webp
Thumbnails
-q 75 -w 400
E-commerce products
-q 85 -w 1000 --webp
Maximum compression
-q 60 -w 1920 --webp

Tips

  1. Always test on copies first - Use
    --keep
    or
    -o output/
    until you're happy with results
  2. WebP is best for web - Creates files typically 25-35% smaller than optimized JPEG
  3. Quality 80 is a good default - Below 70 you may notice artifacts
  4. Resize matters most - A 4000px image resized to 1920px will be much smaller regardless of compression

See references/REFERENCE.md for detailed technical information.