Skip to content

Latest commit

 

History

History
81 lines (48 loc) · 1.77 KB

README.md

File metadata and controls

81 lines (48 loc) · 1.77 KB

fabric-remove-bg

基于 Fabric.js 的图片编辑工具,结合remove.bg API 能够实现图片背景的快速去除。

在线示例demo




Features

  • 去除背景:remove.bg API 去除图片背景

  • 修改背景:设置图片背景图、背景色

  • 画笔绘图:擦除/修补图片内容

  • 历史记录:撤销/重做

  • 查看图片:拖拽、缩放

  • 本地上传/下载图片

  • 裁剪图片(todo)

Remove.bg API

Configure your API key in .env file

VITE_REMOVE_BG_API_KEY=your_remove.bg_api_key
VITE_REMOVE_BG_API_KEY2=your_clipdrop_api_key

you can get your API key from remove.bg you can get your API key2 from clipdrop API

Note

VITE_APP_REMOVE_BG_KEY is the key for remove.bg API;

VITE_APP_REMOVE_BG_KEY2 is the key for clipdrop API;

Usage

Check the src/pages/index/composables/useRemoveBg.js call api methods:

const blob = await http.fetchRemoveBg(params); // 使用 remove.bg API
// const blob = await http.fetchRemoveBg2(params); // 使用 clipdrop API

Development

npm install
npm run dev

Build

npm run build

Relations

fabric.js

remove.bg API

fabric-eraser-brush

fabricjs-history