🦀 ClawHub
remove background
by @galbria
Remove backgrounds from images — background removal API for transparent PNGs, cutouts, and masks. Segment foreground from background. Powered by Bria RMBG 2....
💡 Examples
Product cutout for e-commerce
Create a transparent product cutout for online stores, catalogs, and marketplaces:
source ~/.agents/skills/remove-background/references/code-examples/bria_client.sh
RESULT_URL=$(bria_call /v2/image/edit/remove_background "/path/to/product.jpg")
curl -sL "$RESULT_URL" -o product_cutout.png
echo "Transparent product cutout saved to product_cutout.png"
Portrait and headshot background removal
Remove backgrounds from headshots and portraits for team pages, social profiles, and compositing:
source ~/.agents/skills/remove-background/references/code-examples/bria_client.sh
RESULT_URL=$(bria_call /v2/image/edit/remove_background "https://example.com/headshot.jpg")
curl -sL "$RESULT_URL" -o headshot_cutout.png
Batch background removal
Process entire directories — remove backgrounds in bulk for e-commerce catalogs and asset pipelines:
source ~/.agents/skills/remove-background/references/code-examples/bria_client.sh
mkdir -p cutouts
for img in images/*.{jpg,png,webp}; do
[ -f "$img" ] || continue
name=$(basename "${img%.*}")
RESULT_URL=$(bria_call /v2/image/edit/remove_background "$img")
if [ -n "$RESULT_URL" ] && [ "$RESULT_URL" != "ERROR"* ]; then
curl -sL "$RESULT_URL" -o "cutouts/${name}_cutout.png"
echo "Done: $name"
else
echo "Failed: $name" >&2
fi
done
Extract foreground subject for compositing
Segment and extract the foreground from any photo to create a cutout for layering and compositing:
source ~/.agents/skills/remove-background/references/code-examples/bria_client.sh
RESULT_URL=$(bria_call /v2/image/edit/remove_background "/path/to/scene.jpg")
curl -sL "$RESULT_URL" -o foreground_cutout.png
TERMINAL
clawhub install image-remove-background