Communitygithub.com

openclip-remove-background

使用 OpenClip 移除圖片背景,並取得透明 PNG。只需 OpenClip 帳號即可免費使用,無需訂閱。

openclip-remove-background 是什麼?

這個技能以無需付費的方式,透過 OpenClip 的遠端 MCP 伺服器移除圖片背景,並回傳保留透明度的 PNG 檔案。使用者只需註冊 OpenClip 帳號,並依平台(Claude Code、Claude Desktop、Cursor 等)設定連線即可開始使用。實際流程包含上傳檔案、呼叫 `remove_background` 工具,以及輪詢非同步工作狀態直到取得結果。由於工具是非同步的,必須實作輪詢機制。輸出為永久有效的 CDN 連結,且檔案帶有 Alpha 通道,因此預覽時可能出現棋盤格或黑色背景,但實際透明圖層已正確保留。若有後續尺寸調整或壓平背景的需求,可再透過同為 OpenClip 生態系的 `openclip-thumbnails`(`edit_image`)來完成。

相容平台✓Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/OpenClip-App/agent-skills/tree/main/skills/openclip-remove-background

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

OpenClip:背景移除

remove_background 接受一張圖片,並回傳去背後的透明 PNG。 完全免費,只需要 OpenClip 帳號,無需訂閱或扣點。沒有需要調整的參數,一次呼叫即可完成所有工作。

設定(一次性)

OpenClip 是一個遠端 MCP 伺服器,網址為 https://openclip.app/mcp。出現 OAuth 提示時請使用你的 OpenClip 帳號登入,不需要複製 API 金鑰。

  • Claude Code: claude mcp add --transport http openclip https://openclip.app/mcp,然後執行 /mcp 進行授權。
  • Claude Desktop / web: 設定 > Connectors >「新增自訂連接器」,貼上該 URL 並登入。
  • Cursor(.cursor/mcp.json):{ "mcpServers": { "openclip": { "url": "https://openclip.app/mcp" } } }
  • 僅使用標頭的用戶端: 在 openclip.app/settings/connect 產生一個 MCP token,然後連接到 https://openclip.app/mcp/key,並帶上 Authorization: Bearer <token>。

快速驗證:呼叫 get_account。

流程

  1. 上傳。 create_upload(filename, content_type) 會回傳一個 id 與一個 upload_url。 將原始位元組用 PUT 請求傳送到 upload_url,然後將 id 作為 file 參數傳入。 請勿呼叫 complete_upload,那會啟動付費的去背流程。免費工具直接讀取已上傳的檔案。
  2. 呼叫。 remove_background(file)。無需其他參數。
  3. 輪詢。 回傳一個 tool_job hashid。每 5 到 10 秒輪詢一次 get_tool_job_status(tool_job)。 queued / processing 表示正在進行中,completed 會回傳一個永久的 CDN outputs URL,指向透明 PNG,failed 則回傳 error。
  4. 回傳 PNG URL。 該 PNG 是透明的,在某些預覽中會顯示成棋盤格或黑色背景,這是正常的,Alpha 通道依然存在。

規則

  • 一定要輪詢,此工具是非同步的。
  • 輸出永遠是 PNG。透明度需要 Alpha 通道,因此無法使用 JPG。如果使用者希望之後將背景壓平到某個顏色或調整尺寸,請串聯 edit_image(請參閱 openclip-thumbnails)。
  • 輸出的 URL 是永久的 CDN 連結,不會簽署也不會過期。
  • 免費使用有每日速率限制及單一檔案大小上限。錯誤訊息會說明如何解除限制。

範例提示到動作的對應

  • 「移除這張照片的背景」 - create_upload、PUT 位元組、remove_background(file)、輪詢、回傳透明 PNG URL。
  • 「把這個產品去背,準備上架」 - 同上,然後若需要特定尺寸,對輸出使用 edit_image(file, operation="resize", ...)。
  • 「我需要這個標誌的背景是透明的」 - 同上,然後回傳 PNG。

相關功能

調整大小、裁切及重新格式化圖片是 openclip-thumbnails(edit_image)的功能。從影片中擷取影格來去背也是 openclip-thumbnails(extract_thumbnails)的功能。

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

OpenClip-App/agent-skills

OpenClip captions: burn styled animated captions into short clips.

OpenClip-App/agent-skills

OpenClip clipping: long video → short vertical clips ranked by virality score.

OpenClip-App/agent-skills

OpenClip agent skill for clipping long-form into short-form social clips.

openclip-convert

Convert and compress media from your agent with OpenClip - video to mp4, webm, mov, mkv, or gif, and audio to mp3, aac, wav, or flac. FREE with just an OpenClip account, no subscription. Use when asked to

openclip-repurpose

Turn one long video into a full batch of platform-ready short clips for TikTok, Reels, and YouTube Shorts with OpenClip - find the moments, reframe to vertical, burn in captions, and write the post copy for each. Use when asked to

openclip-thumbnails

Pull still frames out of a video as thumbnail images with OpenClip, then compress, resize, crop, or reformat them to jpg, png, or webp. FREE with just an OpenClip account, no subscription. Use when asked for

openclip-transcription

Transcribe video or audio to JSON, SRT, and VTT with speaker diarization and time codes, using OpenClip. FREE with just an OpenClip account, no subscription. Use when asked to

openclip-ugc-ads

Generate short vertical UGC-style ad clips from a structured creative brief with OpenClip, picking from a roster of AI creators. Use when asked to

openclip-video-editing

Edit a video file from your agent with OpenClip - trim, crop, reframe to 9:16 or 1:1, resize, rotate, flip, compress to a target size, or mute the audio. FREE with just an OpenClip account, no subscription. Use when asked to

相關技能