agentsclimarketplace

Batch image compressor

Skill congemcd/skills-collection/skills/batch-image-compressor

Install
npx -y skills add congemcd/skills-collection --skill batch-image-compressor

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Compress JPEG and PNG images in a directory without changing resolution or format using jpegoptim and pngquant. Use when the user wants to reduce image file sizes in a directory.

SKILL.md

2.4 KB, as published. Nobody here has run it

Batch Image Compressor

This skill compresses JPEG and PNG images in a directory without changing their resolution or format. It uses jpegoptim and pngquant CLI tools to achieve high compression with excellent quality preservation. pngquant provides massive file size reductions for PNGs by intelligently reducing the number of colors while keeping visual differences nearly imperceptible.

Workflow

  1. Check Dependencies: Before doing anything else, check if jpegoptim and pngquant are installed by running which jpegoptim and which pngquant. If either tool is missing, explicitly explain to the user why they are needed (to perform the high-quality, resolution-preserving compression) and directly execute the command to install them via Homebrew (brew install jpegoptim pngquant). Do not wait for the user to do it manually.
  2. Analyze Directory: Locate all .jpg, .jpeg, and .png files in the target directory (defaulting to the current working directory). Calculate the total size of these images before compression. Inform the user how many images were found and the total starting size.
  3. Determine Naming/Overwrite Rules: Do NOT directly compress and overwrite original images unless the user explicitly states to do so. If the user does not specify a naming rule, create new images and add a "compressed-" prefix to their filenames (e.g., compressed-image.jpg). If the user does not specify an output directory, output the new compressed images in the same directory as the original images.
  4. Compress JPEGs: For each .jpg and .jpeg file found:
    • If preserving originals, copy the file first (e.g., cp "img.jpg" "compressed-img.jpg") and then execute jpegoptim -m80 --strip-all "compressed-img.jpg".
    • If overwriting, execute jpegoptim -m80 --strip-all "<file>".
  5. Compress PNGs: For each .png file found:
    • If preserving originals, execute pngquant --output "compressed-img.png" "img.png".
    • If overwriting, execute pngquant --ext .png --force "<file>".
  6. Summary Report: After all images are processed, calculate the new total size of the compressed images. Report the original total size, the new total size, and the total space saved in a concise summary.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.