ByByBG APIへようこそ
ByByBG APIを利用すると、高度なAIモデルを使用して画像の背景を自動削除できます。
当社のインフラは、高速性、拡張性、安全性、および本番環境向け統合のために最適化されています。
高速AI処理
最適化されたAIサーバーにより、数秒で背景を削除します。
安全なAPI
APIキー認証と暗号化通信によりリクエストを保護します。
マルチプラットフォーム対応
Webサイト、モバイルアプリ、バックエンドサーバー、SaaS製品、自動化システムで利用可能です。
大量処理対応
単一画像から大規模バッチ処理まで効率的に対応します。
シンプルな背景削除ワークフロー
画像をアップロード
ユーザーはアップロードフォームやドラッグ&ドロップで画像を選択します。
APIリクエストを送信
バックエンドがプライベートAPIキーを使用して画像を安全に送信します。
透過PNGを受信
AIが画像を処理し、透過PNG画像を即座に返します。
公式APIエンドポイント
以下のPOSTエンドポイントへリクエストを送信してAI背景削除を実行します。
POST https://api.bybybg.com/v1/remove-bg
すぐに使える背景削除デモ
以下のファイルをコピーし、APIキーを追加してサーバーへアップロードするだけで背景削除ツールを利用できます。
プロジェクトフォルダー構成
project/
├── index.html
├── style.css
├── script.js
└── remove-bg.php
index.html
index.html という名前のファイルを作成し、以下のコードを貼り付けてください。
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="upload-box">
<input type="file"
id="imageInput"
accept="image/*">
<button id="uploadBtn">
Remove Background
</button>
<img id="preview">
</div>
<script src="script.js"></script>
</body>
</html>
style.css
body{
background:#0f172a;
color:white;
font-family:Arial;
padding:40px;
}
.upload-box{
max-width:500px;
margin:auto;
padding:30px;
background:#111827;
border-radius:20px;
text-align:center;
}
button{
padding:14px 22px;
border:none;
border-radius:10px;
cursor:pointer;
}
img{
width:100%;
margin-top:20px;
}
script.js
const input = document.getElementById("imageInput");
const button = document.getElementById("uploadBtn");
const preview = document.getElementById("preview");
button.onclick = async () => {
if(!input.files.length) return;
const formData = new FormData();
formData.append("file", input.files[0]);
const response = await fetch("remove-bg.php", {
method:"POST",
body:formData
});
const blob = await response.blob();
preview.src = URL.createObjectURL(blob);
};
remove-bg.php
remove-bg.php という名前のファイルを作成し、YOUR_API_KEY を実際のAPIキーに置き換えてください。
<?php
$apiKey = "YOUR_API_KEY";
$ch = curl_init(
"https://api.bybybg.com/v1/remove-bg?format=png"
);
$cfile = new CURLFile(
$_FILES['file']['tmp_name']
);
curl_setopt_array($ch,[
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => [
'file' => $cfile
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-KEY: '.$apiKey,
'Accept: image/png'
]
]);
$response = curl_exec($ch);
curl_close($ch);
header('Content-Type:image/png');
echo $response;
セットアップ手順
- コンピューターまたはホスティング環境に新しいプロジェクトフォルダーを作成します。
- 上記と同じ名前でファイルを作成します。
- 各ファイルに提供されたコードを貼り付けます。
- YOUR_API_KEY を実際の ByByBG APIキーに置き換えます。
- ファイルをホスティング環境へアップロードし、ブラウザで index.html を開きます。
始める準備はできましたか?
APIキーを取得して、今すぐAI背景削除機能を統合しましょう。