mcpField
B
background-removal

background-removal

github.com/eachlabsクリエイティブ・メディア46467 回インストール1 日前に更新
リポジトリ

background-removal について

background-removalは、each::senseを使って画像の被写体を切り抜き、透明画像として出力したり背景を置き換えたりするスキルです。商品やポートレートの処理に対応し、髪や毛並みなど細かな輪郭の保持も案内します。

主な機能

  1. 01透明PNGの切り抜き
  2. 02単色背景への置き換え
  3. 03シーン背景への置き換え
  4. 04髪や複雑な輪郭の処理
  5. 05画像の一括処理
  6. 06商品とポートレートの処理

活用シーン

  1. 01オンライン商品掲載用の切り抜き作成
  2. 02ポートレートの背景を整える
  3. 03被写体を新しいシーンに合成

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/eachlabs/skills --skill background-removal

インストール後、Claude Code で/background-removalを入力して読み込まれたか確認します。

同梱ファイルreferences/SSE-EVENTS.md

詳細

背景の除去

each::sense を使用して画像から背景を除去します。このスキルでは、透明な背景のプロフェッショナルな切り抜きを作成し、背景を単色やシーンに置き換え、髪や毛皮などの複雑な輪郭も正確に処理します。

機能

  • 透明 PNG の書き出し:アルファチャンネルの透過を使った、きれいな切り抜き
  • 単色への置き換え:背景を任意の単色に置き換えます
  • シーンへの置き換え:被写体を新しい環境に配置します
  • 髪の細部の保持:細かなディテールを捉える高度なエッジ検出
  • 複雑な輪郭の処理:難しい被写体も正確に切り抜きます
  • バッチ処理:複数の画像から背景を除去します
  • E コマース対応:オンラインストア向けに最適化された商品画像の切り抜き
  • ポートレートの最適化:プロ品質のヘッドショットやプロフィール写真

クイックスタート

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this image and export as transparent PNG"}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/my-photo.jpg"],
    "mode": "max"
  }'

ユースケースの例

1. 商品画像の背景除去

E コマースの商品掲載に適した、きれいな切り抜きを作成します。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this product photo. Create a clean cutout with transparent background, preserving all product details and shadows. Output as PNG."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/product-shoe.jpg"],
    "mode": "max"
  }'
2. ポートレートの背景除去

ビジネス用または個人用の、プロ品質のヘッドショットを切り抜きます。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this portrait photo. Preserve all hair details and create clean edges around the person. Export as transparent PNG for professional use."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/headshot.jpg"],
    "mode": "max"
  }'
3. 透明 PNG の書き出し

アルファチャンネル付きで書き出し、デザインソフトウェアで使用します。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this image and export as a high-quality transparent PNG. Ensure clean alpha channel edges suitable for compositing in Photoshop or Figma."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/object.jpg"],
    "mode": "max"
  }'
4. 背景を単色に置き換え

背景を指定した単色に置き換えます。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this product image and replace it with a pure white background (#FFFFFF). Keep the product shadows for a natural look."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/product.jpg"],
    "mode": "max"
  }'
5. 背景を別のシーンに置き換え

被写体をまったく新しい環境に配置します。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this person photo and place them in a modern office environment with soft natural lighting from large windows. Make it look natural and professional."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/person.jpg"],
    "mode": "max"
  }'
6. 髪の細部の保持

複雑な髪の輪郭を正確に処理します。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this portrait. Pay special attention to preserving fine hair details, flyaway strands, and wispy edges. The subject has curly hair that needs careful edge handling. Export as transparent PNG."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/curly-hair-portrait.jpg"],
    "mode": "max"
  }'
7. 複雑な輪郭の処理

毛皮、羽毛、半透明の物体など、扱いが難しい被写体を処理します。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this image of a fluffy cat. Preserve all the fur details including the soft edges and individual hair strands. The cat has white fur which is challenging - maintain clean edges without halos."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/fluffy-cat.jpg"],
    "mode": "max"
  }'
8. 背景の一括除去

複数の商品画像を一貫した仕上がりで処理します。

# First image in batch
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this product image. Export as transparent PNG with consistent edge quality."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/product-1.jpg"],
    "session_id": "batch-background-removal-001",
    "mode": "eco"
  }'

# Second image (same session for consistency)
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this product image with the same settings as before."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/product-2.jpg"],
    "session_id": "batch-background-removal-001",
    "mode": "eco"
  }'

# Third image
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this product image, same approach."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/product-3.jpg"],
    "session_id": "batch-background-removal-001",
    "mode": "eco"
  }'
9. E コマース向けの商品画像の切り抜き

Amazon/Shopify に対応した、白背景の商品画像を作成します。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create an e-commerce ready product cutout from this image. Remove the background and replace with pure white. The product should be centered with clean edges. This is for Amazon/Shopify listing - must meet marketplace image requirements."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/product-handbag.jpg"],
    "mode": "max"
  }'
10. ソーシャルメディアのプロフィール写真

背景がきれいな、プロ品質のプロフィール写真を作成します。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this selfie and replace with a professional gradient background (dark blue to light blue). Preserve all hair details. This is for a LinkedIn profile photo - make it look polished and professional."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/selfie.jpg"],
    "mode": "max"
  }'

複数ターンでのクリエイティブな調整

session_id を使って、背景除去の結果を調整します。

# Initial removal
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Remove the background from this portrait photo"}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/portrait.jpg"],
    "session_id": "portrait-project-001"
  }'

# Refine the result
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "The hair edges look a bit rough. Can you refine them to be smoother and more natural?"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "portrait-project-001"
  }'

# Change background
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Now place this cutout on a beach sunset background"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "portrait-project-001"
  }'

モードの選択

生成する前に、ユーザーに確認してください。

「速さと低コストを優先しますか? それとも高品質を優先しますか?」

モード最適な用途速度品質
max最終制作画像、複雑な輪郭、髪の細部遅め最高
ecoクイックプレビュー、バッチ処理、単純な物体速め良好

ベストプラクティス

商品の場合
  • 照明:最良の結果を得るには、元画像の照明を均一にしてください
  • コントラスト:商品と背景のコントラストが高いほど、精度が向上します
  • 影:自然な仕上がりにするには、影を残すよう指定してください
  • 解像度:入力画像の解像度が高いほど、輪郭の品質が向上します
ポートレートの場合
  • 髪:エッジ検出の精度を高めるには、プロンプトで髪質に触れてください
  • 衣服:衣服の輪郭が背景に溶け込む場合は、その形状を説明してください
  • アクセサリー:保持する必要がある眼鏡、ジュエリー、アイテムを伝えてください
複雑な被写体の場合
  • 透明度:ガラス、煙、半透明の要素について伝えてください
  • 細部:毛皮、羽毛、複雑な模様を指定してください
  • 複数の被写体:残すものと除去するものを説明してください

プロンプトのヒント

背景の除去を依頼する際は、以下を含めてください。

  1. 被写体の種類:商品、人物、動物、物体
  2. 輪郭の複雑さ:単純な輪郭か、髪/毛皮/細部を含む輪郭か
  3. 出力形式:透明 PNG または置き換え後の背景
  4. 背景色:単色に置き換える場合は、具体的な 16 進数コード
  5. 用途:E コマース、ソーシャルメディア、合成など
プロンプトの構成例
"Remove the background from this [subject type].
[Specific edge requirements like hair or fur details].
Output as [transparent PNG / white background / specific scene].
This is for [use case] - [any specific requirements]."

エラー処理

エラー原因解決策
Failed to create prediction: HTTP 422残高不足eachlabs.ai でチャージしてください
輪郭の品質が低い入力画像の解像度が低いより高解像度の元画像を使用してください
輪郭の周囲にハローが出る背景色が複雑エッジ検出の精度を高めるには max モードを使用してください
タイムアウト画像が大きい、または処理が複雑クライアントのタイムアウトを最低 10 分に設定してください

関連スキル

  • each-sense - コア API ドキュメント
  • product-photo-generation - 商品画像をゼロから生成します
  • image-edit - 一般的な画像編集機能

コメント