name: bg-remover description: Remove backgrounds from images using Apple's native Vision framework. Use this skill when the user asks to remove background from an image, remove bg, make image transparent, or extract subject from photo.
This skill provides instructions for using the BGRemover CLI tool to remove backgrounds from images using Apple's native Vision framework API (VNGenerateForegroundInstanceMaskRequest).
Tool Location
The tool is located at: bg_remover
Usage
bg_remover <input_image> <output_image>
Arguments:
input_image- Path to the input image file (JPEG, PNG, HEIC, TIFF, etc.)output_image- Path for the output image (saved as PNG to preserve transparency)
Examples
- Remove background from a photo:
bg_remover photo.jpg output.png
- Process multiple images (in a loop):
for img in *.jpg; do
bg_remover "$img" "${img%.*}-no-bg.png"
done
Requirements
- macOS 14.0 (Sonoma) or later
- The Vision framework API used requires a physical Mac (not supported in simulator)
Use Cases
- Remove background from product photos
- Extract subjects from photos for compositing
- Create transparent images for logos or icons
- Prepare images for design projects
Notes
- Output is always PNG format to preserve transparency
- Works best with photos containing distinct subjects (people, objects, animals)
- The tool uses Apple's on-device ML, so no internet connection required
- Processing time varies based on image size and complexity