Files
membank/.trae/skills/image-tools/SKILL.md
2026-04-05 02:34:24 +08:00

72 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: image-tools
description: 图片处理工具集用于检查图片信息、HTML转PNG、裁剪水印等操作。当用户需要处理产品图片、转换HTML为图片、或去除图片水印时使用此技能。
---
# Image Tools
## Overview
提供产品图片处理相关功能包括检查图片元信息、HTML页面截图、裁剪水印等操作。适用于产品文档和图片批量处理场景。
## Quick Start
使用前需安装依赖:
```bash
cd tools/image-tools/scripts
npm install
```
## Tasks
### 检查图片信息
查看图片的宽度、高度、格式等元信息:
```bash
cd tools/image-tools/scripts
node check-image-info.js
```
**用途**:批量检查产品图片尺寸,确保符合规格要求。
### HTML 转 PNG
将HTML文件转换为PNG图片截图
```bash
cd tools/image-tools/scripts
node convert-html-to-png.js
```
**用途**将产品配置清单HTML转换为PNG图片用于产品展示。
### 裁剪水印
裁剪图片底部水印区域默认裁剪底部300px
```bash
cd tools/image-tools/scripts
node remove-watermark.js
```
**用途**:批量处理产品图片,去除底部水印。
## Configuration
脚本默认处理路径为 `产品/飞牛 NAS/fyd-亚克力机箱 - 单/详情` 目录。如需修改:
- **check-image-info.js**: 修改 `imageDir` 变量
- **convert-html-to-png.js**: 修改 `detailDir` 变量及文件过滤条件
- **remove-watermark.js**: 修改 `imageDir``CROP_BOTTOM_HEIGHT` 常量
## Resources
### scripts/
- `check-image-info.js` - 图片信息检查脚本
- `convert-html-to-png.js` - HTML转PNG截图脚本
- `remove-watermark.js` - 水印裁剪脚本
- `package.json` - Node.js 依赖配置