cssmagic/agent-skills/convert-png-to-webp
Claude Code and agent skill by cssmagic/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when converting PNG images in a directory tree to lossless WebP in place with `cwebp`, preserving original file timestamps, deleting the source PNG files only after successful conversion, and reporting the processed image count.
Install
npx vskill@latest install cssmagic/agent-skills/convert-png-to-webpSKILL.md
The same SKILL.md was published earlier as cssmagic/agent-skills/convert-png-to-webp.
Convert PNG to WebP
Purpose
Convert PNG files inside one directory tree to same-location .webp files:
- Convert PNG files to lossless WebP.
- Preserve original modification time and, on macOS, creation time.
- Delete each source PNG only after its WebP replacement is complete.
- Report how many PNG files were processed.
Required Input
Each run needs one directory to process.
If the directory is missing or ambiguous, ask the user for the path before running commands.
Normalize ~ and relative paths to an absolute path before reporting or running the script.
Defaults
Treat PNG extensions case-insensitively.
Map each PNG to a same-directory, same-basename .webp file.
Do not overwrite existing .webp files unless the user explicitly allows overwrite behavior. If a mapped .webp already exists, report the exact PNG and WebP paths and stop before converting anything.
Reject symlinked PNG files before writing, because deleting a symlink after conversion is easy to misread.
Prerequisites
Use the official WebP CLI:
The bundled script requires Python 3:
On macOS, creation-time preservation requires:
If those macOS timestamp tools are unavailable, stop before converting anything.
Workflow
Set the directory from the user's provided path:
Run the bundled script from this skill directory:
Only pass --overwrite if the user explicitly permits replacing existing mapped WebP files:
The script performs preflight checks before writing:
- required commands
- directory existence
- existing mapped WebP files
- target path collisions, including case-insensitive collisions
- symlinked PNG files
During conversion, the script writes a temporary WebP beside the source file, syncs timestamps, atomically moves it into place, and only then deletes the source PNG.
Reporting
Summarize with:
- directory
- PNG files found
- converted WebP files
- deleted original PNG files
- failed files, if any
- timestamp failure count
- whether macOS creation times were synced
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/convert-png-to-webp/SKILL.md
Popularity
- Repository stars
- 4
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cssmagic/agent-skills/convert-png-to-webp)