{"skill":{"slug":"pixmind-image-compress","displayName":"Pixmind Image Compress","summary":"Cloud-powered image compression and resize — compress JPG/PNG/WebP/HEIC to WebP/AVIF, resize images, batch process folders. No local dependencies, uses Tence...","description":"---\nname: pixmind-image-compress\ndescription: \"Cloud-powered image compression and resize — compress JPG/PNG/WebP/HEIC to WebP/AVIF, resize images, batch process folders. No local dependencies, uses Tencent Cloud COS imageMogr2 via Pixmind API. Save 60-90% file size with scene presets (web, wechat, email, thumbnail). Supports format conversion, quality control, and dimension adjustment.\"\nhomepage: https://www.pixmind.io\nmetadata: {\"openclaw\": {\"requires\": {\"env\": [\"PIXMIND_API_KEY\"]}, \"primaryEnv\": \"PIXMIND_API_KEY\"}}\n---\n\n# Pixmind Image Compress\n\nCloud-powered image compression and resize. Compress JPG, PNG, WebP, HEIC photos to WebP, AVIF or smaller JPG — save 60-90% file size with zero local dependencies.\n\nPowered by [Pixmind](https://www.pixmind.io) + Tencent Cloud COS [imageMogr2](https://cloud.tencent.com/document/product/460/36540).\n\n## Why this skill?\n\n- **Zero install** — No sharp, ImageMagick, or native modules. Runs on any platform with just an API key.\n- **Cloud-processed** — Handles HEIC, AVIF, TPG formats that local tools struggle with.\n- **Scene presets** — One command for web, WeChat, email, or archival use.\n- **Batch ready** — Compress entire folders recursively.\n- **Safe by default** — Never overwrites originals, auto-numbered output.\n\n## When to use\n\n**Use this skill when the user mentions:**\n\n1. **Compress** — \"图片太大\"、\"压缩一下\"、\"缩小文件\"、\"reduce image size\"、\"compress photo\"、\"file too large\"\n2. **Format conversion** — \"转成 JPG\"、\"PNG 转 WebP\"、\"HEIC 转 JPG\"、\"convert to webp\"、\"change format\"\n3. **Resize** — \"缩小到 1920px\"、\"调整尺寸\"、\"resize image\"、\"reduce dimensions\"、\"scale down\"\n4. **Batch** — \"批量压缩\"、\"处理这个文件夹\"、\"compress all images\"、\"batch resize\"\n5. **Scene optimization** — \"用于邮件附件\"、\"上传网站\"、\"微信发送\"、\"optimize for web\"、\"shrink for email\"\n6. **Typical triggers**:\n   - \"帮我压缩这张图片，文件太大了发不了微信\"\n   - \"Screenshot.png is 10MB, make it smaller\"\n   - \"Convert all PNGs in this folder to WebP\"\n   - \"Resize these photos to max 1920px width\"\n\n**Do NOT trigger for:**\n- Image generation (use `pixmind-image` skill)\n- Image editing (crop, rotate, watermark, filters)\n- Image analysis (OCR, content recognition, EXIF reading)\n\n## Prerequisites\n\n1. Register at [pixmind.io](https://www.pixmind.io/) — **200 bonus points on signup** (free trial)\n2. Create an API key at [pixmind.io/api-keys](https://www.pixmind.io/api-keys)\n3. Set env `PIXMIND_API_KEY` with your key\n\n## Quick Start\n\n```bash\n# Compress a single image (local file)\nnode {baseDir}/compress.js --file ~/Desktop/photo.png --preset web\n\n# Compress from URL\nnode {baseDir}/compress.js --url https://example.com/image.jpg --quality 80 --format webp\n\n# Resize to max 1920px width\nnode {baseDir}/compress.js --file photo.jpg --width 1920\n\n# Batch compress a folder\nnode {baseDir}/compress.js --dir ~/Pictures/ --preset web --recursive\n```\n\n## Presets\n\nQuick scene-based compression — no need to remember quality numbers:\n\n| Preset | Quality | Format | Use Case | Savings |\n|--------|---------|--------|----------|---------|\n| `web` | 75 | WebP | Website, blog, CMS upload | 60-70% |\n| `wechat` | 65 | JPG | WeChat, social media sharing | 70-80% |\n| `email` | 55 | JPG | Email attachments, fast transfer | 80-90% |\n| `quality` | 95 | original | High-quality archiving, print | 30-40% |\n| `thumbnail` | 60 | WebP | Thumbnails, previews, avatars | 80-90% |\n\n## API Details\n\n**Endpoint**: `POST https://aihub-admin.aimix.pro/open/cos/image/compress`\n**Auth**: Header `X-API-Key: {API_KEY}` and `X-App-Key: {APP_KEY}`\n\n### Request Body (JSON)\n\n| Parameter | Required | Type | Description |\n|-----------|----------|------|-------------|\n| `imageUrl` | One of | string | Image URL (COS or external link) |\n| `imageBase64` | One of | string | Base64 image data (supports `data:image/xxx;base64,` prefix) |\n| `format` | No | string | Output format: `webp`, `jpg`, `png`, `avif`, `heif`, `tpg` |\n| `quality` | No | number | Compression quality 1-100 (default: 75) |\n| `width` | No | number | Target width in pixels (maintains aspect ratio) |\n| `height` | No | number | Target height in pixels (maintains aspect ratio) |\n| `mode` | No | string | Response type: `url` (default) or `base64` |\n\n### Response Format\n\n```json\n{\n  \"code\": 1000,\n  \"message\": \"success\",\n  \"data\": {\n    \"originalUrl\": \"https://bucket.cos.region.myqcloud.com/image.jpg\",\n    \"compressedUrl\": \"https://bucket.cos.region.myqcloud.com/image.jpg?imageMogr2/format/webp/quality/75\",\n    \"originalSize\": 1024000,\n    \"compressedSize\": 256000,\n    \"format\": \"webp\",\n    \"quality\": 75,\n    \"width\": 800,\n    \"height\": 600\n  }\n}\n```\n\n## Supported Formats\n\n**Input**: JPG, JPEG, PNG, WebP, GIF, BMP, HEIC, HEIF\n**Output**: `webp`, `jpg`, `png`, `avif`, `heif`, `tpg`\n\n## CLI Options\n\n| Option | Short | Type | Default | Description |\n|--------|-------|------|---------|-------------|\n| `--url` | `-u` | string | — | Image URL to compress |\n| `--file` | `-f` | string | — | Local image file path |\n| `--dir` | `-d` | string | — | Directory for batch processing |\n| `--format` | | string | original | Output: webp, jpg, png, avif, heif, tpg |\n| `--quality` | `-q` | number | 75 | Quality 1-100 |\n| `--width` | `-w` | number | — | Target width (maintain ratio) |\n| `--height` | | number | — | Target height (maintain ratio) |\n| `--preset` | `-p` | string | — | web, wechat, email, quality, thumbnail |\n| `--output` | `-o` | string | auto | Output directory |\n| `--recursive` | `-r` | boolean | false | Process subdirectories |\n| `--mode` | | string | url | Response: url or base64 |\n\n## Output Rules\n\n- Compressed files saved to `~/Downloads/compressed-images/{date}/` by default\n- Original files are **never** modified or overwritten\n- Duplicate filenames auto-numbered: `photo_001.jpg`, `photo_002.jpg`\n- Batch mode preserves original directory structure\n\n## Guidelines\n\n1. For local files, the script auto-reads and converts to Base64 for upload\n2. Default to quality 75 — good balance of quality and size\n3. Match presets to use cases: `web` for sites, `wechat` for sharing, `email` for attachments\n4. When resizing, specify only one dimension to maintain aspect ratio\n5. For batch processing, show progress and total savings summary\n6. After compression, always show before/after size and savings percentage\n7. Prefer `webp` for web — best compression with good quality\n8. For photos: recommend `jpg` or `webp`; for screenshots/diagrams: `png` or `webp`\n9. HEIC (iPhone) photos are natively supported — no extra dependencies needed\n","topics":["Batch","Email","WeChat"],"tags":{"latest":"1.0.1"},"stats":{"comments":0,"downloads":339,"installsAllTime":13,"installsCurrent":0,"stars":0,"versions":2},"createdAt":1777695060704,"updatedAt":1778492826217},"latestVersion":{"version":"1.0.1","createdAt":1777695574971,"changelog":"Fix: default API base URL to production endpoint (aihub-admin.aimix.pro)","license":"MIT-0"},"metadata":{"setup":[{"key":"PIXMIND_API_KEY","required":true}],"os":null,"systems":null},"owner":{"handle":"fuyunzhishang","userId":"s17cjqv5bh3ckgqc9bvsvvxjkn840t25","displayName":"Pixmind","image":"https://avatars.githubusercontent.com/u/19215394?v=4"},"moderation":null}