AI SummaryA skill that removes backgrounds from images using FAL.ai's BiRefNet model, enabling developers to quickly extract subjects and create transparent PNGs. Useful for anyone building image processing features into Claude-based applications.
Install
# Add to your project root as SKILL.md curl -o SKILL.md "https://raw.githubusercontent.com/majiayu000/claude-skill-registry/main/skills/data/bg-remover/SKILL.md"
Description
Remove backgrounds from images using FAL.ai's BiRefNet model. Use when users ask to remove background, make transparent PNG, extract subject from image, or create cutouts. Trigger phrases include "remove background", "transparent background", "cut out", "extract subject", or any background removal request.
Prerequisites
This skill requires: • Bun - Fast JavaScript runtime • FAL_KEY - FAL.ai API key set as environment variable
Basic Usage
Remove background from an image using a heredoc script: `bash bun run - << 'EOF' import { fal } from "@fal-ai/client"; import { readFileSync, writeFileSync } from "fs"; import { basename, dirname, join } from "path"; const imagePath = "INPUT_IMAGE_PATH"; const imageBuffer = readFileSync(imagePath); const fileName = basename(imagePath); const mimeType = imagePath.endsWith(".png") ? "image/png" : "image/jpeg"; // Upload to FAL storage const file = new File([imageBuffer], fileName, { type: mimeType }); const imageUrl = await fal.storage.upload(file); console.log("Uploaded:", imageUrl); // Remove background const result = await fal.subscribe("fal-ai/birefnet/v2", { input: { image_url: imageUrl, model: "General Use (Light)", operating_resolution: "1024x1024", output_format: "png" }, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS" && update.logs) { update.logs.map((log) => log.message).forEach(console.log); } }, }); // Download and save result const outputUrl = result.data.image.url; const response = await fetch(outputUrl); const buffer = Buffer.from(await response.arrayBuffer()); const dir = dirname(imagePath); const nameWithoutExt = basename(imagePath, basename(imagePath).match(/\.[^.]+$/)?.[0] || ""); const outputPath = join(dir, ${nameWithoutExt}-nobg.png); writeFileSync(outputPath, buffer); console.log("Saved:", outputPath); EOF ` Replace INPUT_IMAGE_PATH with the actual path to the image.
Advanced Usage
For batch processing, URL-based inputs, or integration with other tools, see references/guide.md.
Background Remover Skill
Remove backgrounds from images using FAL.ai's BiRefNet v2 model. Uses Bun for fast TypeScript execution with inline scripts.
Quality Score
Good
81/100
Trust & Transparency
Open Source — MIT
Source code publicly auditable
Verified Open Source
Hosted on GitHub — publicly auditable
Actively Maintained
Last commit Yesterday
100 stars — Growing Community
15 forks