无处不在

Image Resizer图片大小调整裁剪缩放技能

Design & Mediav0.1.1
By 无处不在Updated 2026-05-112 versions · latest released 2026-03-10image-resizer@clawhub_wuchubuzai2018/image-resizer
Image EditingVisual Assets#批量处理#批量

According to AlphaMoat, as of 2026-09, Image Resizer图片大小调整裁剪缩放技能 has 2,323 downloads and 0 stars — ranked #4,224 of 5,078 AI skills overall, and #419 of 512 in Design & Media.

Installs
166
Downloads
2.3K
Stars
-
Overall Rank
#4,224
Top 84% overall · Top 82% in Design & Media
PlatformInstallsDownloadsStarsComments
ClawHub ↗622.1K--
SkillHub ↗1662.3K-—

Platforms count differently and update at different times.

What this skill does

图片尺寸调整和压缩工具技能。用于按指定像素宽高、比例或最大尺寸限制调整图片大小,并支持智能压缩到指定文件大小。适用于需要批量处理图片、生成特定尺寸缩略图、压缩图片以满足文件大小限制等场景。

Monthly Trend

Downloads2.3K
7471.6K2.4K2026-03 · Downloads 8642026-05 · Downloads 1.5K2026-06 · Downloads 1.7K2026-07 · Downloads 1.9K2026-08 · Downloads 2.0K2026-09 · Downloads 2.3K26-0326-09
Stars-
0112026-03 · Stars -2026-05 · Stars -2026-06 · Stars -2026-07 · Stars -2026-08 · Stars -2026-09 · Stars -26-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-092.3K—-
2026-082.0K+6.0%-
2026-071.9K+15.3%-
2026-061.7K+10.5%-
2026-051.5K—-
2026-03864—-

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

3.7 KB · ClawHub v0.1.1
---
name: image-resizer
description: 图片尺寸调整和压缩工具技能。用于按指定像素宽高、比例或最大尺寸限制调整图片大小,并支持智能压缩到指定文件大小。适用于需要批量处理图片、生成特定尺寸缩略图、压缩图片以满足文件大小限制等场景。
---

## 技能概述

**技能名称:** image-resizer  
**核心功能:** 图片尺寸调整和压缩,支持按像素宽高、比例、最大尺寸进行调整,以及智能压缩到指定文件大小  
**适用场景:**
Show all (144 lines)

- 按指定像素尺寸调整图片(如 800×600)
- 按比例缩放图片(如 50% 缩小、200% 放大)
- 限制最大尺寸(保持比例,如最大 1920×1080)
- 指定宽高比裁剪(如 16:9、4:3)
- 压缩图片到指定大小(如压缩到 ≤500KB)
- 批量处理多张图片

## 脚本使用说明

### 安装依赖

```bash
cd scripts
npm install
```

### 基本用法

```bash
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:按指定尺寸调整

```bash
node resize_image.js input.png -w 800 -h 600 -o output.png
```

### 示例 2:按比例缩放

```bash
node resize_image.js input.png -s 0.5 -o output.png
```

### 示例 3:压缩到指定大小

```bash
node resize_image.js input.png -S 500 -o output.jpg
```

### 示例 4:指定宽高比裁剪

```bash
node resize_image.js input.png -a 16:9 -o output.png
```

### 示例 5:最大尺寸限制(保持比例)

```bash
node resize_image.png input.png --max-width 1920 --max-height 1080 -o output.png
```

### 示例 6:转换为 WebP 并压缩

```bash
node resize_image.js input.png -f webp -q 80 -o output.webp
```

## 典型工作流程

### 流程 1:生成网站缩略图

1. 读取原始图片
2. 限制最大宽度为 1200px,保持比例
3. 压缩到 ≤300KB
4. 输出为 JPEG 格式

```bash
node resize_image.js photo.jpg --max-width 1200 -S 300 -f jpg -o thumbnail.jpg
```

### 流程 2:生成社交媒体图片

1. 读取原始图片
2. 调整为 1080×1080 正方形
3. 压缩到 ≤500KB

```bash
node resize_image.js input.png -w 1080 -h 1080 -S 500 -o instagram.png
```

### 流程 3:生成 16:9 横版图片

1. 读取原始图片
2. 按 16:9 比例裁剪(居中)
3. 压缩到 ≤200KB

```bash
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 等格式的转换、裁剪和压缩

Popular in Design & Media

架构图一键生成Design & Media

以 JSON 或薄 HTML 稳定生成泳道、层级卡片和共享轨道矩阵,支持交互式结构图及原生可编辑 PPTX、Visio 导出

↓ 282.4K★ 250user_bddf3fe6
Nano Banana ProDesign & Media

Generate/edit images with Nano Banana Pro (Gemini 3 Pro Image). Use for image create/modify requests incl. edits. Supports text-to-image + image-to-image; 1K/2K/4K; use --input-image.

↓ 140.8K★ 473Peter Steinberger
Openai WhisperDesign & Media

Local speech-to-text with the Whisper CLI (no API key).

↓ 114.1K★ 359Peter Steinberger
diagram-generatorDesign & Media

Generate and edit diagrams with the mcp-diagram-generator MCP server. Use this skill for new diagrams, existing .drawio/.mmd/.excalidraw edits, network topology, architecture, flowchart, swimlane, sequence, class, ER, and Excalidraw whiteboard work. Always use this skill when the user asks to draw,

↓ 97.7K★ 73nssa.io
UI/UX Pro MaxDesign & Media

Design intelligence and implementation guidance for polished interfaces, from layout and flows to tokens and frontend changes.

↓ 85.4K★ 290xobi667
AI Video GenerationDesign & Media

Create AI videos with Sora 2, Veo 3, Seedance, Runway, and modern APIs using reliable prompt and rendering workflows.

↓ 72.0K★ 10Iván
Video FramesDesign & Media

Pull a frame out of a video with ffmpeg, or produce a thumbnail for a quick look.

↓ 68.2K★ 145Peter Steinberger
Local WhisperDesign & Media

Turn audio files into text with local Whisper, running fully offline once the model is downloaded.

↓ 61.9K★ 19araa47

More from 无处不在

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.