
image-resizer
图片尺寸调整和压缩工具技能。用于按指定像素宽高、比例或最大尺寸限制调整图片大小,并支持智能压缩到指定文件大小。适用于需要批量处理图片、生成特定尺寸缩略图、压缩图片以满足文件大小限制等场景。
- Installs
- 64
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/wuchubuzai2018/expert-skills-hub --skill image-resizer- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads image-resizer automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
技能概述
技能名称: image-resizer
核心功能: 图片尺寸调整和压缩,支持按像素宽高、比例、最大尺寸进行调整,以及智能压缩到指定文件大小
适用场景:
- 按指定像素尺寸调整图片(如 800×600)
- 按比例缩放图片(如 50% 缩小、200% 放大)
- 限制最大尺寸(保持比例,如最大 1920×1080)
- 指定宽高比裁剪(如 16:9、4:3)
- 压缩图片到指定大小(如压缩到 ≤500KB)
- 批量处理多张图片
脚本使用说明
安装依赖
cd scripts
npm install
基本用法
node resize_image.js <输入图片> [选项]
选项说明
| 参数 | 简写 | 说明 | 示例 |
|---|---|---|---|
--width | -w | 目标宽度(像素) | -w 800 |
--height | -h | 目标高度(像素) | -h 600 |
--scale | -s | 缩放比例 | -s 0.5 |
--max-width | - | 最大宽度(保持比例) | --max-width 1920 |
--max-height | - | 最大高度(保持比例) | --max-height 1080 |
--quality | -q | 输出质量 1-100 | -q 80 |
--size | -S | 目标文件大小(KB),自动压缩 | -S 500 |
--format | -f | 输出格式:png|jpg|webp|original | -f webp |
--output | -o | 输出路径 | -o output.png |
--aspect-ratio | -a | 目标宽高比 | -a 16:9 |
--fit | - | 适应模式 | --fit cover |
适应模式说明
| 模式 | 说明 |
|---|---|
cover | 填充整个区域(可能裁剪,默认) |
contain | 完整放入区域内(可能留白) |
fill | 拉伸填充 |
inside | 完整放入(仅缩小) |
outside | 完全覆盖(仅放大) |
使用示例
示例 1:按指定尺寸调整
node resize_image.js input.png -w 800 -h 600 -o output.png
示例 2:按比例缩放
node resize_image.js input.png -s 0.5 -o output.png
示例 3:压缩到指定大小
node resize_image.js input.png -S 500 -o output.jpg
示例 4:指定宽高比裁剪
node resize_image.js input.png -a 16:9 -o output.png
示例 5:最大尺寸限制(保持比例)
node resize_image.png input.png --max-width 1920 --max-height 1080 -o output.png
示例 6:转换为 WebP 并压缩
node resize_image.js input.png -f webp -q 80 -o output.webp
典型工作流程
流程 1:生成网站缩略图
- 读取原始图片
- 限制最大宽度为 1200px,保持比例
- 压缩到 ≤300KB
- 输出为 JPEG 格式
node resize_image.js photo.jpg --max-width 1200 -S 300 -f jpg -o thumbnail.jpg
流程 2:生成社交媒体图片
- 读取原始图片
- 调整为 1080×1080 正方形
- 压缩到 ≤500KB
node resize_image.js input.png -w 1080 -h 1080 -S 500 -o instagram.png
流程 3:生成 16:9 横版图片
- 读取原始图片
- 按 16:9 比例裁剪(居中)
- 压缩到 ≤200KB
node resize_image.js input.png -a 16:9 -S 200 -o 16_9.jpg
技能文件结构
image-resizer/
├── SKILL.md # 技能主文件
└── scripts/
├── resize_image.js # 图片处理脚本
└── package.json # 依赖配置
依赖说明
- sharp: 图片处理库,支持 PNG、JPEG、WebP 等格式的转换、裁剪和压缩
FAQ
What does the image-resizer skill do?
图片尺寸调整和压缩工具技能。用于按指定像素宽高、比例或最大尺寸限制调整图片大小,并支持智能压缩到指定文件大小。适用于需要批量处理图片、生成特定尺寸缩略图、压缩图片以满足文件大小限制等场景。
How do I install image-resizer?
Run npx skills add https://github.com/wuchubuzai2018/expert-skills-hub --skill image-resizer in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/image-resizer/ (personal) or .claude/skills/image-resizer/ (project).
Which AI agents can use image-resizer?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is image-resizer safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains image-resizer?
It is published by wuchubuzai2018 in wuchubuzai2018/expert-skills-hub. It has 64 recorded installs.
More from wuchubuzai2018/expert-skills-hub
wechat-article-search
wuchubuzai2018/expert-skills-hub
搜索微信公众号文章技能。通过微信搜索获取文章列表,覆盖科技/AI、社会热点、财经、教育、职场等各类中文资讯;可按关键词检索并返回标题、概要、发布时间、来源公众号与链接。当用户需要查找微信公众号文章、整理参考资料或快速获取文章信息时使用此技能。
toutiao-news-trends
wuchubuzai2018/expert-skills-hub
Open the skill to read its SKILL.md instructions.
nano-banana-pro-image-gen
wuchubuzai2018/expert-skills-hub
Open the skill to read its SKILL.md instructions.
apiyi-gpt-image-2-gen
wuchubuzai2018/expert-skills-hub
Open the skill to read its SKILL.md instructions.
csdn-article-publish
wuchubuzai2018/expert-skills-hub
Open the skill to read its SKILL.md instructions.
juejin-article-trends
wuchubuzai2018/expert-skills-hub
Open the skill to read its SKILL.md instructions.
Popular media & creative skills
hyperframes
heygen-com/hyperframes
Read first to make, edit, animate or render any video with HyperFrames (HTML rendered to video), including launch films, explainers, music videos, charts, maps, vertical clips, title cards, captions and overlays. Holds the render contract, the work loop and what each kind of video needs.
media-use
heygen-com/hyperframes
Get or make any media for a HyperFrames video - music, sound effects, images, icons, logos, voiceover, avatar and generated video, transcripts, cutouts, colour grades and looks - with HeyGen or free local tools, and mix placed audio. Also for footage that looks dark, flat or dull, or should be stylized or hidden.
hyperframes-registry
heygen-com/hyperframes
About 450 ready-made HyperFrames blocks and components installed as editable source - transitions, overlays, titles, kinetic type, captions, charts, map overlays, 3D, camera moves. Use it before hand-building any named visual (CRT scanlines, glitch, film grain, a chart); also for hyperframes add and catalog.
hyperframes-creative
heygen-com/hyperframes
Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use hyperframes-animation.
ai-video-generation
101-skills/superpowers
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
ai-image-generation
101-skills/superpowers
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image