用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/fabioc-aloha/Alex_Skill_Mall --skill image-storage-embedding-split命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | image-storage-embedding-split |
| description | Storing images at embed size loses the original: |
| lastReviewed | 2026-04-30T00:00:00.000Z |
Storing images at embed size loses the original:
Keep originals at full resolution. Embed at reduced size.
const sharp = require('sharp');
async function processImage(inputPath, outputDir) {
const filename = path.basename(inputPath, path.extname(inputPath));
// Store original at full resolution
const original = await sharp(inputPath)
.resize(512, 512, { fit: 'inside' })
.toFile(path.join(outputDir, `${filename}-512.png`));
// Create embed version at reduced size
const embed = await sharp(inputPath)
.resize(256, 256, { fit: 'inside' })
.toBuffer();
// Return both
return {
originalPath: path.join(outputDir, `${filename}-512.png`),
embedDataUri: `data:image/png;base64,${embed.toString('base64')}`,
embedSize: 256
};
}
{
"images": [
{
"id": "avatar-001",
"originalPath": "assets/avatar-001-512.png",
"embedDataUri": "data:image/png;base64,iVBOR...",
"embedSize": 256,
"originalSize": 512
}
]
}
| Size | Base64 Size | Token Estimate |
|---|---|---|
| 512px | ~42KB | ~10,500 tokens |
| 256px | ~13KB | ~3,250 tokens |
| Savings | ~70% | ~7,250 tokens |
images ai tokens storage