JSPM

koishi-plugin-removebg-pro

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 28
  • Score
    100M100P100Q61426F
  • License MIT

一个基于 remove.bg API 的 Koishi 插件,用于移除图片背景。

Package Exports

  • koishi-plugin-removebg-pro
  • koishi-plugin-removebg-pro/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (koishi-plugin-removebg-pro) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

koishi-plugin-removebg-pro

NPM version NPM license

调用 remove.bg 的 API 来移除图片背景。支持丰富的配置项和灵活的指令调用。

📦 安装

您可以前往 Koishi 插件市场,搜索 removebg-pro 并安装。

⚙️ 配置

安装完成后,请在 Koishi 控制台的插件配置页面进行设置。

  • apiKey: (必需) 您的 remove.bg API 密钥。
  • commandName: (可选) 触发插件的指令名称,默认为 removebg
  • API 参数配置:
    • 在此区域内,您可以预设图片处理的默认参数,如输出格式、图片尺寸、默认背景色等。所有配置项均有详细说明。

🔑 API 密钥与使用限制

remove.bg 的 API 为每个账户提供每月 50 次的免费调用额度。 超出额度后 API 将无法使用,直到下个月重置。

您可以按照以下步骤获取您的 API 密钥:

  1. 访问 remove.bg 官网并注册账户。
  2. https://www.remove.bg/api#remove-background 点击 Get API Key 选项。
  3. 创建一个新的 API Key 并将其复制到本插件的 apiKey 配置项中。

📖 指令用法

本插件的指令设计兼顾了配置的便利性与调用的灵活性。

基础用法

直接发送指令并附带一张图片,或回复(引用)一张已有的图片。插件将根据您的预设配置进行处理。

/removebg [图片]

进阶用法:临时指定背景色

使用 -b--bg 选项可以临时指定一个背景色,该颜色会覆盖您在配置中设定的默认背景色。

  1. 指令、选项、图片在同一条消息中发送:

    /removebg -b green [图片]
  2. 回复(引用)一张图片,再发送指令和选项: (在回复某张图片后发送)

    /removebg -b ffffff

📝 免责声明

  • 本插件是基于 remove.bg 公共 API 开发的第三方工具,与 remove.bg 官方无任何关联。
  • 请妥善保管您的 API Key。任何因 API Key 滥用或泄露导致的损失,本插件作者概不负责。
  • 使用本插件即表示您同意并承诺遵守 remove.bg 的服务条款。
  • 本插件按“原样”提供,不提供任何明示或暗示的保证。

© 许可证

本项目基于 MIT 许可证发布。