Skill: sanford284/image-process (version 0.1.0)

--- name: "image-process" description: "Image processing tool for compression, background removal/replacement, and upscaling. Invoke when user wants to compress image, remove background, change background, or enlarge image." --- # Image Process Skill This skill provides image processing capabilities including compression, background removal, background replacement, and upscaling. ## Features - **Image Compression**: Compress images to reduce file size with adjustable quality - **Background Removal**: AI-powered background removal using `@imgly/background-removal` - **Background Replacement**: Replace background with a custom color or another image - **Image Upscaling**: Enlarge images to bigger dimensions ## Usage ### 1. Compress Image ```javascript const { compressImage } = require('./index'); const result = await compressImage({ input: './image.jpg', quality: 80, output: './compressed.jpg' }); ``` ### 2. Remove Background ```javascript const { removeBackground } = require('./index'); const result = await removeBackground({ input: './person.jpg', output: './person-nobg.png' }); ``` ### 3. Replace Background ```javascript const { replaceBackground } = require('./index'); // Replace with solid color const result = await replaceBackground({ input: './person.jpg', background: '#ffffff', output: './result.jpg' }); // Replace with another image const result = await replaceBackground({ input: './person.jpg', background: './background.jpg', output: './result.jpg' }); ``` ### 4. Upscale Image ```javascript const { upscaleImage } = require('./index'); // Scale by factor (2x) const result = await upscaleImage({ input: './image.jpg', scale: 2, output: './upscaled.jpg' }); // Or specify exact dimensions const result = await upscaleImage({ input: './image.jpg', width: 2000, height: 3000, output: './upscaled.jpg' }); ``` ## Parameters ### compressImage | Parameter | Type | Description | |-----------|------|-------------| | `input` | string | Path to input image | | `quality` | number | Compression quality (1-100), default 80 | | `output` | string | Output file path | ### removeBackground | Parameter | Type | Description | |-----------|------|-------------| | `input` | string/Buffer | Path or buffer of input image | | `output` | string | Output file path (optional) | ### replaceBackground | Parameter | Type | Description | |-----------|------|-------------| | `input` | string | Path to foreground image | | `background` | string | Hex color (e.g. '#ffffff') or path to background image | | `output` | string | Output file path | ### upscaleImage | Parameter | Type | Description | |-----------|------|-------------| | `input` | string | Path to input image | | `scale` | number | Scale factor (e.g. 2 for 2x), default 2 | | `width` | number | Target width (overrides scale) | | `height` | number | Target height (overrides scale) | | `output` | string | Output file path | ## CLI Commands ```bash # Compress image-process compress ./photo.jpg -q 80 # Remove background image-process remove-bg ./person.jpg # Replace background image-process replace-bg ./person.jpg "#ffffff" image-process replace-bg ./person.jpg ./background.jpg # Upscale image-process upscale ./photo.jpg -s 2 image-process upscale ./photo.jpg -w 2000 -h 3000 ``` ## Installation ```bash cd E:\cvte\skills\image-process npm install ``` ## Dependencies - `@imgly/background-removal-node` - AI background removal - `sharp` - High-performance image processing

path: SKILL_CN.md
content: ---
name: "image-process"
description: "图片处理工具，支持压缩、去背景、换背景、放大图片。当用户需要压缩图片、去除背景、更换背景或放大图片时调用。"
---

# 图片处理技能

提供图片处理功能，包括压缩、去背景、换背景和放大图片。

## 功能

- **图片压缩**: 压缩图片以减小文件大小，可调节压缩质量
- **去除背景**: 使用 AI 智能去除图片背景
- **更换背景**: 将背景替换为纯色或其他图片
- **图片放大**: 将图片放大到更大尺寸

## 使用方法

### 1. 压缩图片

```javascript
const { compressImage } = require('./index');

const result = await compressImage({
  input: './image.jpg',
  quality: 80,
  output: './compressed.jpg'
});
```

### 2. 去除背景

```javascript
const { removeBackground } = require('./index');

const result = await removeBackground({
  input: './person.jpg',
  output: './person-nobg.png'
});
```

### 3. 更换背景

```javascript
const { replaceBackground } = require('./index');

// 替换为纯色背景
const result = await replaceBackground({
  input: './person.jpg',
  background: '#ffffff',
  output: './result.jpg'
});

// 替换为其他图片背景
const result = await replaceBackground({
  input: './person.jpg',
  background: './background.jpg',
  output: './result.jpg'
});
```

### 4. 放大图片

```javascript
const { upscaleImage } = require('./index');

// 按倍数放大 (2倍)
const result = await upscaleImage({
  input: './image.jpg',
  scale: 2,
  output: './upscaled.jpg'
});

// 或指定具体尺寸
const result = await upscaleImage({
  input: './image.jpg',
  width: 2000,
  height: 3000,
  output: './upscaled.jpg'
});
```

## 参数说明

### compressImage 压缩图片

| 参数 | 类型 | 说明 |
|-----------|------|-------------|
| `input` | string | 输入图片路径 |
| `quality` | number | 压缩质量 (1-100)，默认 80 |
| `output` | string | 输出文件路径 |

### removeBackground 去除背景

| 参数 | 类型 | 说明 |
|-----------|------|-------------|
| `input` | string/Buffer | 输入图片路径或 Buffer |
| `output` | string | 输出文件路径 (可选) |

### replaceBackground 更换背景

| 参数 | 类型 | 说明 |
|-----------|------|-------------|
| `input` | string | 前景图片路径 |
| `background` | string | 十六进制颜色 (如 '#ffffff') 或背景图片路径 |
| `output` | string | 输出文件路径 |

### upscaleImage 放大图片

| 参数 | 类型 | 说明 |
|-----------|------|-------------|
| `input` | string | 输入图片路径 |
| `scale` | number | 放大倍数 (如 2 表示 2 倍)，默认 2 |
| `width` | number | 目标宽度 (设置后忽略 scale) |
| `height` | number | 目标高度 (设置后忽略 scale) |
| `output` | string | 输出文件路径 |

## 命令行使用

```bash
# 压缩图片
image-process compress ./photo.jpg -q 80

# 去除背景
image-process remove-bg ./person.jpg

# 更换背景
image-process replace-bg ./person.jpg "#ffffff"
image-process replace-bg ./person.jpg ./background.jpg

# 放大图片
image-process upscale ./photo.jpg -s 2
image-process upscale ./photo.jpg -w 2000 -h 3000
```

## 安装依赖

```bash
cd E:\cvte\skills\image-process
npm install
```

## 依赖库

- `@imgly/background-removal-node` - AI 背景去除
- `sharp` - 高性能图片处理


path: cli.js
content: import { program } from "commander";
import {
  compressImage,
  removeBackground,
  replaceBackground,
  upscaleImage,
} from "./index.js";

program
  .name("image-process")
  .description("Image processing tool: compress, remove/replace background")
  .version("1.0.0");

program
  .command("compress <input> [output]")
  .description("Compress an image")
  .option("-q, --quality <quality>", "Quality (1-100)", "80")
  .option("-w, --max-width <width>", "Max width")
  .option("-h, --max-height <height>", "Max height")
  .action(async (input, output, options) => {
    try {
      const outputPath = output || input.replace(/(\.[^.]+)$/, '-compressed$1');
      console.log('Compressing: ' + input);
      await compressImage({
        input,
        quality: parseInt(options.quality),
        maxWidth: options.maxWidth ? parseInt(options.maxWidth) : undefined,
        maxHeight: options.maxHeight ? parseInt(options.maxHeight) : undefined,
        output: outputPath,
      });
      console.log('Saved to: ' + outputPath);
    } catch (error) {
      console.error('Error:', error.message);
      process.exit(1);
    }
  });

program
  .command("remove-bg <input> [output]")
  .description("Remove background from an image")
  .action(async (input, output) => {
    try {
      const outputPath = output || input.replace(/(\.[^.]+)$/, '-nobg.png');
      console.log('Removing background from: ' + input);
      await removeBackground({
        input,
        output: outputPath,
        onProgress: (key, current, total) => {
          console.log('  Progress: ' + Math.round((current / total) * 100) + '%');
        },
      });
      console.log('Saved to: ' + outputPath);
    } catch (error) {
      console.error('Error:', error.message);
      process.exit(1);
    }
  });

program
  .command("replace-bg <input> <background> [output]")
  .description("Replace background with color (#ffffff) or another image")
  .option("-q, --quality <quality>", "Output quality (1-100)", "95")
  .action(async (input, background, output, options) => {
    try {
      const outputPath = output || input.replace(/(\.[^.]+)$/, '-newbg$1');
      console.log('Replacing background...');
      console.log('  Input: ' + input);
      console.log('  Background: ' + background);
      await replaceBackground({
        input,
        background,
        quality: parseInt(options.quality),
        output: outputPath,
      });
      console.log('Saved to: ' + outputPath);
    } catch (error) {
      console.error('Error:', error.message);
      process.exit(1);
    }
  });

program
  .command("upscale <input> [output]")
  .description("Upscale image to larger size")
  .option("-s, --scale <scale>", "Scale factor (e.g. 2 for 2x)", "2")
  .option("-w, --width <width>", "Target width (overrides scale)")
  .option("-h, --height <height>", "Target height (overrides scale)")
  .option("-q, --quality <quality>", "Output quality (1-100)", "95")
  .action(async (input, output, options) => {
    try {
      const outputPath = output || input.replace(/(\.[^.]+)$/, '-upscaled$1');
      console.log('Upscaling: ' + input);
      await upscaleImage({
        input,
        scale: parseFloat(options.scale),
        width: options.width ? parseInt(options.width) : undefined,
        height: options.height ? parseInt(options.height) : undefined,
        quality: parseInt(options.quality),
        output: outputPath,
      });
      console.log('Saved to: ' + outputPath);
    } catch (error) {
      console.error('Error:', error.message);
      process.exit(1);
    }
  });

program.parse();


path: index.js
content: import { removeBackground } from "@imgly/background-removal-node";
import sharp from "sharp";
import fs from "fs/promises";
import path from "path";

const getMimeType = (filePath) => {
  const ext = path.extname(filePath).toLowerCase();
  const mimeTypes = {
    '.jpg': 'image/jpeg',
    '.jpeg': 'image/jpeg',
    '.png': 'image/png',
    '.webp': 'image/webp',
  };
  return mimeTypes[ext] || 'image/jpeg';
};

/**
 * Compress image with adjustable quality
 * @param {Object} options
 * @param {string|Buffer} options.input - Input file path or buffer
 * @param {number} options.quality - Compression quality (1-100), default 80
 * @param {string} options.output - Output file path (optional)
 * @param {number} options.maxWidth - Max width (optional)
 * @param {number} options.maxHeight - Max height (optional)
 */
const compressImage = async (options) => {
  const {
    input,
    quality = 80,
    output,
    maxWidth,
    maxHeight,
  } = options;

  let imageBuffer;
  if (typeof input === "string") {
    imageBuffer = await fs.readFile(path.resolve(input));
  } else if (Buffer.isBuffer(input)) {
    imageBuffer = input;
  } else {
    throw new Error("Input must be a file path string or Buffer");
  }

  let pipeline = sharp(imageBuffer);

  if (maxWidth || maxHeight) {
    pipeline = pipeline.resize(maxWidth, maxHeight, {
      fit: 'inside',
      withoutEnlargement: true,
    });
  }

  const ext = output ? path.extname(output).toLowerCase() : '.jpg';

  if (ext === '.png') {
    pipeline = pipeline.png({ compressionLevel: 9 });
  } else if (ext === '.webp') {
    pipeline = pipeline.webp({ quality });
  } else {
    pipeline = pipeline.jpeg({ quality, mozjpeg: true });
  }

  const result = await pipeline.toBuffer();

  if (output) {
    await fs.writeFile(path.resolve(output), result);
    console.log('Compressed image saved to: ' + output);
  }

  return result;
};

/**
 * Remove background from image using AI
 * @param {Object} options
 * @param {string|Buffer} options.input - Input file path or buffer
 * @param {string} options.output - Output file path (optional)
 * @param {Function} options.onProgress - Progress callback (optional)
 */
const removeBackgroundFromImage = async (options) => {
  const { input, output, onProgress } = options;

  const config = {
    progress: (key, current, total) => {
      if (onProgress) {
        onProgress(key, current, total);
      }
    },
  };

  let imageBlob;
  if (typeof input === "string") {
    const absolutePath = path.resolve(input);
    const imageBuffer = await fs.readFile(absolutePath);
    const mimeType = getMimeType(input);
    imageBlob = new Blob([imageBuffer], { type: mimeType });
  } else if (Buffer.isBuffer(input)) {
    imageBlob = new Blob([input], { type: 'image/jpeg' });
  } else {
    throw new Error("Input must be a file path string or Buffer");
  }

  const result = await removeBackground(imageBlob, config);
  const resultBuffer = Buffer.from(await result.arrayBuffer());

  if (output) {
    await fs.writeFile(path.resolve(output), resultBuffer);
    console.log('Background removed image saved to: ' + output);
  }

  return resultBuffer;
};

/**
 * Replace background with solid color or another image
 * @param {Object} options
 * @param {string|Buffer} options.input - Foreground image path or buffer
 * @param {string} options.background - Hex color (e.g. '#ffffff') or path to background image
 * @param {string} options.output - Output file path (optional)
 * @param {number} options.quality - Output quality (1-100), default 95
 */
const replaceBackground = async (options) => {
  const {
    input,
    background,
    output,
    quality = 95,
  } = options;

  let foregroundBuffer;
  if (typeof input === "string") {
    foregroundBuffer = await fs.readFile(path.resolve(input));
  } else if (Buffer.isBuffer(input)) {
    foregroundBuffer = input;
  } else {
    throw new Error("Input must be a file path string or Buffer");
  }

  console.log("Removing background from foreground...");
  const foregroundNoBg = await removeBackgroundFromImage({ input: foregroundBuffer });

  const fgMeta = await sharp(foregroundNoBg).metadata();

  let bgBuffer;

  if (background.startsWith('#') || background.startsWith('rgb')) {
    bgBuffer = await sharp({
      create: {
        width: fgMeta.width,
        height: fgMeta.height,
        channels: 3,
        background: background,
      }
    }).png().toBuffer();
  } else {
    bgBuffer = await fs.readFile(path.resolve(background));
    bgBuffer = await sharp(bgBuffer)
      .resize(fgMeta.width, fgMeta.height, { fit: 'cover' })
      .toBuffer();
  }

  const result = await sharp(bgBuffer)
    .composite([
      {
        input: foregroundNoBg,
        top: 0,
        left: 0,
      },
    ])
    .jpeg({ quality })
    .toBuffer();

  if (output) {
    await fs.writeFile(path.resolve(output), result);
    console.log('Background replaced image saved to: ' + output);
  }

  return result;
};

/**
 * Upscale image to larger size
 * @param {Object} options
 * @param {string|Buffer} options.input - Input file path or buffer
 * @param {number} options.scale - Scale factor (e.g. 2 for 2x), default 2
 * @param {number} options.width - Target width (optional, overrides scale)
 * @param {number} options.height - Target height (optional, overrides scale)
 * @param {string} options.output - Output file path (optional)
 * @param {number} options.quality - Output quality (1-100), default 95
 */
const upscaleImage = async (options) => {
  const {
    input,
    scale = 2,
    width,
    height,
    output,
    quality = 95,
  } = options;

  let imageBuffer;
  if (typeof input === "string") {
    imageBuffer = await fs.readFile(path.resolve(input));
  } else if (Buffer.isBuffer(input)) {
    imageBuffer = input;
  } else {
    throw new Error("Input must be a file path string or Buffer");
  }

  const meta = await sharp(imageBuffer).metadata();

  let targetWidth = width;
  let targetHeight = height;

  if (!targetWidth && !targetHeight) {
    targetWidth = Math.round(meta.width * scale);
    targetHeight = Math.round(meta.height * scale);
  } else if (targetWidth && !targetHeight) {
    targetHeight = Math.round(targetWidth * (meta.height / meta.width));
  } else if (!targetWidth && targetHeight) {
    targetWidth = Math.round(targetHeight * (meta.width / meta.height));
  }

  console.log('Upscaling from ' + meta.width + 'x' + meta.height + ' to ' + targetWidth + 'x' + targetHeight);

  const result = await sharp(imageBuffer)
    .resize(targetWidth, targetHeight, {
      kernel: 'lanczos3',
      fit: 'fill',
    })
    .jpeg({ quality })
    .toBuffer();

  if (output) {
    await fs.writeFile(path.resolve(output), result);
    console.log('Upscaled image saved to: ' + output);
  }

  return result;
};

export {
  compressImage,
  removeBackgroundFromImage as removeBackground,
  replaceBackground,
  upscaleImage,
};

export default {
  compressImage,
  removeBackground: removeBackgroundFromImage,
  replaceBackground,
  upscaleImage,
};


path: package-lock.json
content: {
  "name": "image-merge-skill",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "image-merge-skill",
      "version": "1.0.0",
      "license": "MIT",
      "dependencies": {
        "@imgly/background-removal-node": "^1.4.5",
        "commander": "^12.0.0",
        "sharp": "^0.32.6"
      },
      "bin": {
        "image-merge": "cli.js"
      }
    },
    "node_modules/@imgly/background-removal-node": {
      "version": "1.4.5",
      "resolved": "https://registry.npmjs.org/@imgly/background-removal-node/-/background-removal-node-1.4.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "SEE LICENSE IN LICENSE.md",
      "dependencies": {
        "@types/lodash": "~4.14.195",
        "@types/ndarray": "~1.0.14",
        "@types/node": "~20.3.1",
        "lodash": "~4.17.21",
        "ndarray": "~1.0.19",
        "onnxruntime-node": "~1.17.0",
        "sharp": "~0.32.4",
        "zod": "~3.21.4"
      }
    },
    "node_modules/@isaacs/fs-minipass": {
      "version": "4.0.1",
      "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "dependencies": {
        "minipass": "^7.0.4"
      },
      "engines": {
        "node": ">=18.0.0"
      }
    },
    "node_modules/@types/lodash": {
      "version": "4.14.202",
      "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/@types/ndarray": {
      "version": "1.0.14",
      "resolved": "https://registry.npmjs.org/@types/ndarray/-/ndarray-1.0.14.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/@types/node": {
      "version": "20.3.3",
      "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/b4a": {
      "version": "1.8.0",
      "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.8.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "peerDependencies": {
        "react-native-b4a": "*"
      },
      "peerDependenciesMeta": {
        "react-native-b4a": {
          "optional": true
        }
      }
    },
    "node_modules/bare-events": {
      "version": "2.8.2",
      "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "peerDependencies": {
        "bare-abort-controller": "*"
      },
      "peerDependenciesMeta": {
        "bare-abort-controller": {
          "optional": true
        }
      }
    },
    "node_modules/bare-fs": {
      "version": "4.5.5",
      "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "bare-events": "^2.5.4",
        "bare-path": "^3.0.0",
        "bare-stream": "^2.6.4",
        "bare-url": "^2.2.2",
        "fast-fifo": "^1.3.2"
      },
      "engines": {
        "bare": ">=1.16.0"
      },
      "peerDependencies": {
        "bare-buffer": "*"
      },
      "peerDependenciesMeta": {
        "bare-buffer": {
          "optional": true
        }
      }
    },
    "node_modules/bare-os": {
      "version": "3.7.0",
      "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.7.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "engines": {
        "bare": ">=1.14.0"
      }
    },
    "node_modules/bare-path": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "bare-os": "^3.0.1"
      }
    },
    "node_modules/bare-stream": {
      "version": "2.8.0",
      "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.8.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "streamx": "^2.21.0",
        "teex": "^1.0.1"
      },
      "peerDependencies": {
        "bare-buffer": "*",
        "bare-events": "*"
      },
      "peerDependenciesMeta": {
        "bare-buffer": {
          "optional": true
        },
        "bare-events": {
          "optional": true
        }
      }
    },
    "node_modules/bare-url": {
      "version": "2.3.2",
      "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.3.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "bare-path": "^3.0.0"
      }
    },
    "node_modules/base64-js": {
      "version": "1.5.1",
      "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
      "integrity": [REDACTED_SECRET],
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ],
      "license": "MIT"
    },
    "node_modules/bl": {
      "version": "4.1.0",
      "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "buffer": "^5.5.0",
        "inherits": "^2.0.4",
        "readable-stream": "^3.4.0"
      }
    },
    "node_modules/buffer": {
      "version": "5.7.1",
      "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
      "integrity": [REDACTED_SECRET],
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "base64-js": "^1.3.1",
        "ieee754": "^1.1.13"
      }
    },
    "node_modules/chownr": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BlueOak-1.0.0",
      "engines": {
        "node": ">=18"
      }
    },
    "node_modules/color": {
      "version": "4.2.3",
      "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "color-convert": "^2.0.1",
        "color-string": "^1.9.0"
      },
      "engines": {
        "node": ">=12.5.0"
      }
    },
    "node_modules/color-convert": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "color-name": "~1.1.4"
      },
      "engines": {
        "node": ">=7.0.0"
      }
    },
    "node_modules/color-name": {
      "version": "1.1.4",
      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/color-string": {
      "version": "1.9.1",
      "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "color-name": "^1.0.0",
        "simple-swizzle": "^0.2.2"
      }
    },
    "node_modules/commander": {
      "version": "12.1.0",
      "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">=18"
      }
    },
    "node_modules/decompress-response": {
      "version": "6.0.0",
      "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "mimic-response": "^3.1.0"
      },
      "engines": {
        "node": ">=10"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/deep-extend": {
      "version": "0.6.0",
      "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">=4.0.0"
      }
    },
    "node_modules/detect-libc": {
      "version": "2.1.2",
      "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/end-of-stream": {
      "version": "1.4.5",
      "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "once": "^1.4.0"
      }
    },
    "node_modules/events-universal": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "bare-events": "^2.7.0"
      }
    },
    "node_modules/expand-template": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "(MIT OR WTFPL)",
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/fast-fifo": {
      "version": "1.3.2",
      "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/fs-constants": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/github-from-package": {
      "version": "0.0.0",
      "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/ieee754": {
      "version": "1.2.1",
      "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
      "integrity": [REDACTED_SECRET],
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ],
      "license": "BSD-3-Clause"
    },
    "node_modules/inherits": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC"
    },
    "node_modules/ini": {
      "version": "1.3.8",
      "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC"
    },
    "node_modules/iota-array": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/iota-array/-/iota-array-1.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/is-arrayish": {
      "version": "0.3.4",
      "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/is-buffer": {
      "version": "1.1.6",
      "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/lodash": {
      "version": "4.17.23",
      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/mimic-response": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">=10"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/minimist": {
      "version": "1.2.8",
      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/minipass": {
      "version": "7.1.3",
      "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BlueOak-1.0.0",
      "engines": {
        "node": ">=16 || 14 >=14.17"
      }
    },
    "node_modules/minizlib": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "minipass": "^7.1.2"
      },
      "engines": {
        "node": ">= 18"
      }
    },
    "node_modules/mkdirp-classic": {
      "version": "0.5.3",
      "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/napi-build-utils": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/ndarray": {
      "version": "1.0.19",
      "resolved": "https://registry.npmjs.org/ndarray/-/ndarray-1.0.19.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "iota-array": "^1.0.0",
        "is-buffer": "^1.0.2"
      }
    },
    "node_modules/node-abi": {
      "version": "3.87.0",
      "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.87.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "semver": "^7.3.5"
      },
      "engines": {
        "node": ">=10"
      }
    },
    "node_modules/node-addon-api": {
      "version": "6.1.0",
      "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/once": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "dependencies": {
        "wrappy": "1"
      }
    },
    "node_modules/onnxruntime-common": {
      "version": "1.17.3",
      "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.17.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/onnxruntime-node": {
      "version": "1.17.3",
      "resolved": "https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-1.17.3.tgz",
      "integrity": [REDACTED_SECRET],
      "hasInstallScript": true,
      "license": "MIT",
      "os": [
        "win32",
        "darwin",
        "linux"
      ],
      "dependencies": {
        "onnxruntime-common": "1.17.3",
        "tar": "^7.0.1"
      }
    },
    "node_modules/prebuild-install": {
      "version": "7.1.3",
      "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz",
      "integrity": [REDACTED_SECRET],
      "deprecated": "No longer maintained. Please contact the author of the relevant native addon; alternatives are available.",
      "license": "MIT",
      "dependencies": {
        "detect-libc": "^2.0.0",
        "expand-template": "^2.0.3",
        "github-from-package": "0.0.0",
        "minimist": "^1.2.3",
        "mkdirp-classic": "^0.5.3",
        "napi-build-utils": "^2.0.0",
        "node-abi": "^3.3.0",
        "pump": "^3.0.0",
        "rc": "^1.2.7",
        "simple-get": "^4.0.0",
        "tar-fs": "^2.0.0",
        "tunnel-agent": "^0.6.0"
      },
      "bin": {
        "prebuild-install": "bin.js"
      },
      "engines": {
        "node": ">=10"
      }
    },
    "node_modules/prebuild-install/node_modules/chownr": {
      "version": "1.1.4",
      "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC"
    },
    "node_modules/prebuild-install/node_modules/tar-fs": {
      "version": "2.1.4",
      "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "chownr": "^1.1.1",
        "mkdirp-classic": "^0.5.2",
        "pump": "^3.0.0",
        "tar-stream": "^2.1.4"
      }
    },
    "node_modules/prebuild-install/node_modules/tar-stream": {
      "version": "2.2.0",
      "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "bl": "^4.0.3",
        "end-of-stream": "^1.4.1",
        "fs-constants": "^1.0.0",
        "inherits": "^2.0.3",
        "readable-stream": "^3.1.1"
      },
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/pump": {
      "version": "3.0.4",
      "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "end-of-stream": "^1.1.0",
        "once": "^1.3.1"
      }
    },
    "node_modules/rc": {
      "version": "1.2.8",
      "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "(BSD-2-Clause OR MIT OR Apache-2.0)",
      "dependencies": {
        "deep-extend": "^0.6.0",
        "ini": "~1.3.0",
        "minimist": "^1.2.0",
        "strip-json-comments": "~2.0.1"
      },
      "bin": {
        "rc": "cli.js"
      }
    },
    "node_modules/readable-stream": {
      "version": "3.6.2",
      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "inherits": "^2.0.3",
        "string_decoder": "^1.1.1",
        "util-deprecate": "^1.0.1"
      },
      "engines": {
        "node": ">= 6"
      }
    },
    "node_modules/safe-buffer": {
      "version": "5.2.1",
      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
      "integrity": [REDACTED_SECRET],
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ],
      "license": "MIT"
    },
    "node_modules/semver": {
      "version": "7.7.4",
      "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "bin": {
        "semver": "bin/semver.js"
      },
      "engines": {
        "node": ">=10"
      }
    },
    "node_modules/sharp": {
      "version": "0.32.6",
      "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz",
      "integrity": [REDACTED_SECRET],
      "hasInstallScript": true,
      "license": "Apache-2.0",
      "dependencies": {
        "color": "^4.2.3",
        "detect-libc": "^2.0.2",
        "node-addon-api": "^6.1.0",
        "prebuild-install": "^7.1.1",
        "semver": "^7.5.4",
        "simple-get": "^4.0.1",
        "tar-fs": "^3.0.4",
        "tunnel-agent": "^0.6.0"
      },
      "engines": {
        "node": ">=14.15.0"
      },
      "funding": {
        "url": "https://opencollective.com/libvips"
      }
    },
    "node_modules/simple-concat": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ],
      "license": "MIT"
    },
    "node_modules/simple-get": {
      "version": "4.0.1",
      "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "decompress-response": "^6.0.0",
        "once": "^1.3.1",
        "simple-concat": "^1.0.0"
      }
    },
    "node_modules/simple-swizzle": {
      "version": "0.2.4",
      "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "is-arrayish": "^0.3.1"
      }
    },
    "node_modules/streamx": {
      "version": "2.23.0",
      "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.23.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "events-universal": "^1.0.0",
        "fast-fifo": "^1.3.2",
        "text-decoder": "^1.1.0"
      }
    },
    "node_modules/string_decoder": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "safe-buffer": "~5.2.0"
      }
    },
    "node_modules/strip-json-comments": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/tar": {
      "version": "7.5.9",
      "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.9.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BlueOak-1.0.0",
      "dependencies": {
        "@isaacs/fs-minipass": "^4.0.0",
        "chownr": "^3.0.0",
        "minipass": "^7.1.2",
        "minizlib": "^3.1.0",
        "yallist": "^5.0.0"
      },
      "engines": {
        "node": ">=18"
      }
    },
    "node_modules/tar-fs": {
      "version": "3.1.1",
      "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "pump": "^3.0.0",
        "tar-stream": "^3.1.5"
      },
      "optionalDependencies": {
        "bare-fs": "^4.0.1",
        "bare-path": "^3.0.0"
      }
    },
    "node_modules/tar-stream": {
      "version": "3.1.8",
      "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.8.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "b4a": "^1.6.4",
        "bare-fs": "^4.5.5",
        "fast-fifo": "^1.2.0",
        "streamx": "^2.15.0"
      }
    },
    "node_modules/teex": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "streamx": "^2.12.5"
      }
    },
    "node_modules/text-decoder": {
      "version": "1.2.7",
      "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.7.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "b4a": "^1.6.4"
      }
    },
    "node_modules/tunnel-agent": {
      "version": "0.6.0",
      "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "safe-buffer": "^5.0.1"
      },
      "engines": {
        "node": "*"
      }
    },
    "node_modules/util-deprecate": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/wrappy": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC"
    },
    "node_modules/yallist": {
      "version": "5.0.0",
      "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BlueOak-1.0.0",
      "engines": {
        "node": ">=18"
      }
    },
    "node_modules/zod": {
      "version": "3.21.4",
      "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "funding": {
        "url": "https://github.com/sponsors/colinhacks"
      }
    }
  }
}


path: package.json
content: {
  "name": "image-process-skill",
  "version": "1.0.0",
  "description": "Image processing skill for compression, background removal, and background replacement",
  "main": "index.js",
  "type": "module",
  "bin": {
    "image-process": "./cli.js"
  },
  "scripts": {
    "start": "node cli.js",
    "test": "node test.js"
  },
  "keywords": [
    "image",
    "compress",
    "background-removal",
    "background-replace",
    "ai"
  ],
  "author": "",
  "license": "MIT",
  "dependencies": {
    "@imgly/background-removal-node": "^1.4.5",
    "commander": "^12.0.0",
    "sharp": "^0.32.6"
  }
}


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)