{"slug":"any-picture-format","title":"any-picture-format","summary":"当用户明确要求\"转换图片格式\"、\"修改图片格式\"、\"图片格式转换\"时使用。支持任意格式图片到目标格式的转换，包括：本地文件/网络URL/剪贴板图片输入，PNG/JPEG/WEBP 等常见格式输出，单文件或批量处理模式。核心特点：自动检测输入格式、支持透明度处理、批量处理保持原始文件名结构。⚠️ 不适用：用户只是想调整图片大小/裁剪（应使用图片编辑工具）、只是想查看图片信息（应直接使用文件查看器）、没有明确\"格式转换\"意图。","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-08-27T17:01:26.240166Z","repo":{"url":"https://github.com/huangwb8/skills","stars":48,"forks":8,"license":"MIT","updatedAt":"2026-09-25T04:25:50Z"},"bodyHtml":"<h1>Any Picture Format</h1>\n<p>这个 skill 用来把图片转换成你需要的目标格式，适合单文件、批量目录、URL 图片和剪贴板图片的格式转换；如果你只是想裁剪、缩放或查看图片信息，就不该用它。</p>\n<h2>用法</h2>\n<h3>最推荐用法</h3>\n<pre><code>请使用 any-picture-format skill 将图片格式转换为目标格式。\n输入：`/path/to/image.png` 或图片 URL 或剪贴板图片；目标格式如 `jpeg` / `png` / `webp`\n输出：转换后的图片文件，默认保留原文件并生成新文件\n</code></pre>\n<h3>进阶用法</h3>\n<pre><code>请使用 any-picture-format skill 批量转换一个目录里的图片。\n输入：图片目录 `/path/to/images`；目标格式 `webp`\n输出：批量转换后的图片文件\n另外，还有下列参数约束：\n- 递归处理：是\n- 输出策略：覆盖原文件\n- 质量参数：90\n</code></pre>\n<h2>能做什么</h2>\n<ul>\n<li>支持本地文件、网络 URL、剪贴板图片三种输入来源。</li>\n<li>支持 <code>PNG</code>、<code>JPEG/JPG</code>、<code>WEBP</code>、<code>GIF</code>、<code>BMP</code>、<code>TIFF</code>、<code>ICO</code> 等常见输出格式。</li>\n<li>会根据格式差异处理透明度、质量参数和批量目录结构。</li>\n<li>默认策略是“保留原文件，新生成目标格式文件”。</li>\n<li>不适合裁剪、缩放、加水印或做复杂图像编辑。</li>\n</ul>\n<h2>使用示例</h2>\n<h3>示例 1：转换单张图片</h3>\n<pre><code>请使用 any-picture-format skill 将这张图片转成 JPEG。\n输入：`/tmp/demo.png`\n输出：`/tmp/demo.jpg`\n</code></pre>\n<h3>示例 2：从 URL 转换为 PNG</h3>\n<pre><code>请使用 any-picture-format skill 转换这个网络图片。\n输入：`https://example.com/demo.webp`\n输出：PNG 文件\n另外，还有下列参数约束：\n- 输出策略：新建文件\n</code></pre>\n<h3>示例 3：批量转换整个目录</h3>\n<pre><code>请使用 any-picture-format skill 批量转换图片目录。\n输入：`./assets/raw-images`，目标格式 `webp`\n输出：转换后的图片文件\n另外，还有下列参数约束：\n- 递归处理：是\n- 质量参数：85\n</code></pre>\n<h2>输出</h2>\n<ul>\n<li>单文件转换时，默认在原文件旁生成同名新文件，例如 <code>image.png -&gt; image.jpg</code>。</li>\n<li>批量转换时，默认保留原目录结构和原文件名，只改变扩展名。</li>\n<li>默认不会覆盖原文件；只有显式要求 <code>overwrite</code> 时才会覆盖。</li>\n<li>如果是剪贴板或 URL 输入，技能会先落地临时输入，再生成目标输出。</li>\n</ul>\n<h2>配置</h2>\n<ul>\n<li>配置文件：<code>any-picture-format/config.yaml</code></li>\n<li>默认输出格式：<code>PNG</code></li>\n<li>默认输出策略：<code>new</code></li>\n<li>默认质量参数：<code>85</code></li>\n<li>批量递归默认值：<code>false</code></li>\n<li>高价值配置项：\n<ul>\n<li><code>defaults.output_format</code></li>\n<li><code>defaults.output_strategy</code></li>\n<li><code>defaults.quality</code></li>\n<li><code>output_formats</code></li>\n</ul>\n</li>\n</ul>\n<h2>备选用法（脚本/硬编码）</h2>\n<p>如果你已经明确知道输入路径和目标格式，直接使用脚本会更快。</p>\n<h3>验证输入</h3>\n<pre><code>python3 any-picture-format/scripts/convert.py validate --source /path/to/image.png\n</code></pre>\n<h3>转换单张图片</h3>\n<pre><code>python3 any-picture-format/scripts/convert.py convert \\\n  --source /path/to/image.png \\\n  --format JPEG \\\n  --output /path/to/image.jpg \\\n  --strategy new \\\n  --quality 90\n</code></pre>\n<h3>批量转换目录</h3>\n<pre><code>python3 any-picture-format/scripts/convert.py batch \\\n  --directory /path/to/images \\\n  --format WEBP \\\n  --recursive \\\n  --strategy new \\\n  --quality 85\n</code></pre>\n<h2>常见问题</h2>\n<h3>Q：PNG 转 JPEG 后透明背景怎么办？</h3>\n<p>A：JPEG 不支持透明度，通常会自动合成为纯色背景；如果你需要保留透明度，优先输出为 <code>PNG</code> 或 <code>WEBP</code>。</p>\n<h3>Q：会覆盖原文件吗？</h3>\n<p>A：默认不会。只有明确要求 <code>overwrite</code>，或脚本里传入 <code>--strategy overwrite</code> 时才会覆盖。</p>\n<h3>Q：批量转换时某个文件失败怎么办？</h3>\n<p>A：默认配置 <code>continue_on_error: true</code>，会继续处理其它文件；你可以根据最终报告定位失败项。</p>\n<h3>Q：这个 skill 能顺手做裁剪或缩放吗？</h3>\n<p>A：不能。它的职责是“格式转换”，不是通用图像编辑。</p>\n","files":[{"path":"CHANGELOG.md","sizeBytes":1854,"isText":true},{"path":"config.yaml","sizeBytes":2299,"isText":true},{"path":"README.md","sizeBytes":3963,"isText":true},{"path":"scripts/convert.py","sizeBytes":17560,"isText":true},{"path":"SKILL.md","sizeBytes":9372,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-08T11:57:33.467774Z","sha256":"982778B935AD92E35587285611F7A35B702405DDE372F068918E82D137444CF3","sizeBytes":14053},"review":null,"source":{"repositoryUrl":"https://github.com/huangwb8/skills","path":"skills/beta/any-picture-format","license":"MIT","commit":"9cba9fd64cd22f38af2c2503a11d8247be2090cd","subtreeSha":"B5EB20F26738442F5E59DA1C66E7E1FFA47EBBFAF95B08235A2D4B407B6DA626","lastSyncedAt":"2026-09-25T07:37:25.617865Z"},"reviewedAt":"2026-09-08T12:08:23.175547Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/huangwb8/skills/tree/main/skills/beta/any-picture-format"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install huangwb8-skills@llmmart"},{"target":"git","command":"git clone https://github.com/huangwb8/skills.git"}]}