Image Resizer logo

Image Resizer

Community
wuchubuzai2018
image-resizer

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

Overview

Publisherwuchubuzai2018
Repositoryexpert-skills-hub
Skill nameimage-resizer
Stars
43
Forks
6
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wuchubuzai2018 on GitHub. Read the source before you install it.

Installation

Install the Image Resizer AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/wuchubuzai2018/expert-skills-hub/tree/main/skills/image-resizer
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wuchubuzai2018/expert-skills-hub.git /tmp/expert-skills-hub
mkdir -p .claude/skills
cp -r /tmp/expert-skills-hub/skills/image-resizer .claude/skills/image-resizer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Image Resizer in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Image Resizer on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Image Resizer is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

技能概述

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

  • 按指定像素尺寸调整图片(如 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 等格式的转换、裁剪和压缩

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Image Resizer AI skill do?

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

Why use Image Resizer on TypingMind?

Because you install it once and use it with any model. Image Resizer is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Image Resizer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wuchubuzai2018/expert-skills-hub/tree/main/skills/image-resizer. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Image Resizer?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Image Resizer?

As many as you like. As long as a model supports skills, you can use Image Resizer with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Image Resizer AI skill free?

It is published on GitHub by wuchubuzai2018. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇