from poofbg import Poofclient = Poof(api_key="poof_your_api_key")# From a fileresult = client.remove("input.jpg")result.save("output.png")# From byteswith open("input.jpg", "rb") as f: result = client.remove(f.read()) result.save("output.png")
Install the SDK:
npm install @poof-bg/js
Remove a background:
import { Poof } from '@poof-bg/js';import fs from 'fs/promises';const poof = new Poof({ apiKey: 'poof_your_api_key' });const image = await fs.readFile('input.jpg');const result = await poof.remove(image);await fs.writeFile('output.png', result);