{"uid":"cap_6qgYjgX4TZcjlYVbJ3LX3","slug":"agents-vimmerse-net-vimmerse-replace-background-ef95375f","name":"Vimmerse Replace Background","description":"Removes, replaces, or restyles the background of an image.\n\n| `option` | `image2_url` | Behavior |\n|----------|--------------|----------|\n| `RemoveBackground` | omit | Transparent PNG foreground |\n| `ReplaceBackground` | required | New background image |\n| `RestyleBackground` | required | Style reference image |\n\n### Example — remove background\n\n```python\nimport requests\n\nurl = \"https://api.vimmerse.net/v2/image/replace-background\"\nheaders = {\n    \"X-Api-Key\": \"YOUR_API_KEY\",\n    \"Content-Type\": \"application/json\",\n}\npayload = {\n    \"image_url\": \"https://media.vimmerse.net/example/product.png\",\n    \"option\": \"RemoveBackground\",\n}\n\nresponse = requests.post(url, headers=headers, json=payload, timeout=300)\nresponse.raise_for_status()\nprint(response.json()[\"results\"])\n```\n\n### Example — replace background\n\n```python\npayload = {\n    \"image_url\": \"https://media.vimmerse.net/example/product.png\",\n    \"image2_url\": \"https://media.vimmerse.net/example/studio_bg.png\",\n    \"option\": \"ReplaceBackground\",\n}\n```","url":"https://agents.vimmerse.net/v2/image/replace-background?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","title":"ReplaceBackgroundRequest","required":["image_url"],"properties":{"option":{"type":"string","title":"Option","default":"RemoveBackground","description":"Option to apply. Available values: `RemoveBackground`, `ReplaceBackground`, `RestyleBackground`."},"image_url":{"type":"string","title":"Base Image URL"},"async_mode":{"type":"boolean","title":"Async Mode","default":false},"image2_url":{"type":"string","title":"Additional Image URL (Optional)","default":"","description":"Optional second image used for background replacement."},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook URL"}},"description":"Request body for POST /v2/image/replace-background. Content-Type: application/json."},"responseSchema":{"type":"object","title":"Response Replace Background Api V2 Image Replace Background Post","additionalProperties":true},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.12","displayCostAsset":"USD","priceDynamic":true,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"dynamic","summary":"$0.12/call (dynamic — varies by input)","primary":{"kind":"dynamic","protocol":"mpp","network":"tempo","amountUsd":"0.12","per":"call","confidence":"exact"},"accepted":[{"kind":"dynamic","protocol":"mpp","network":"tempo","amountUsd":"0.12","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_FeJ7Oxk75VGTy1BrScm32","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.12","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":null,"planRef":null}],"brandName":"agents.vimmerse.net","brandSlug":"agents-vimmerse-net-x402","brandBaseUrl":"https://agents.vimmerse.net","brandDocsUrl":null,"whatItDoes":"Removes, replaces, or restyles the background of an image using one of three modes: transparent removal, new background substitution, or style-based restyling.","exampleAgentPrompt":"Remove the background from this product image at https://media.vimmerse.net/example/product.png and give me a transparent PNG I can use on my website.","exampleUseCases":[{"title":"Product photo background removal","prompt":"Take this product image at https://shop.example.com/images/sneaker.png and remove the background entirely — I need a transparent PNG so I can drop it onto any background on my store."},{"title":"Portrait on branded backdrop","prompt":"Replace the background of my headshot at https://cdn.example.com/headshot.jpg with this branded studio background at https://cdn.example.com/studio_bg.png so it looks professional for our website team page."},{"title":"Artistic style background restyle","prompt":"Restyle the background of the photo at https://cdn.example.com/model.jpg using the painting style from https://cdn.example.com/monet_style.png — I want the background to look like an impressionist painting while keeping the subject sharp."}],"resultDescription":"A processed image returned in the 'results' field of the JSON response. For RemoveBackground: a transparent PNG with the foreground subject isolated. For ReplaceBackground: the subject composited onto the provided background image. For RestyleBackground: the background restyled according to the reference image. Async mode jobs return a job ID to poll.","failureModes":["Invalid or inaccessible image_url returns an error","ReplaceBackground or RestyleBackground called without image2_url returns a validation error","Unsupported image format or corrupt image URL causes processing failure","Timeout on very large images (default timeout should be set to 300s)","Invalid API key returns 401 unauthorized","Exceeding credit balance returns 402 payment required"],"whenToPreferThis":"Choose this endpoint when you need to isolate a foreground subject by removing its background, swap a background with a specific replacement image, or restyle a background using a style reference — all without manual masking. It is ideal for e-commerce product photography, portrait editing, and creative compositing workflows where the input is a URL-addressable image.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T22:53:34.836Z","isFirstParty":false,"canonicalSlug":"agents-vimmerse-net-vimmerse-replace-background-ef95375f"}