image-background-replace
Replaces the background or scene of an image while preserving the foreground subject intact. Supports describing the target background via text. Covers product background replacement, portrait background replacement, ID photo background color change (white/blue/red), and AI-generated target scenes. Cannot output a transparent background.
meitu image-background-replace
Usage Examples
# Scenario 1: Default white background replacement
meitu image-background-replace \
--image_url ./sample.jpg \
--json
# Scenario 2: Specify a target background
meitu image-background-replace \
--image_url ./sample.jpg \
--prompt "Sunset beach with warm tones" \
--json
# Scenario 3: Full parameters + download results
meitu image-background-replace \
--image_url ./sample.jpg \
--prompt "Sunset beach with warm tones" \
--json \
--download-dir ./outputParameter Reference
| Parameter | Required | Description |
|---|---|---|
--image_url | Yes | Aliases: --image |
--prompt | No | Type: string |
--download-dir | No | Type: string |
--output | No | Type: string[] |
--json | No | Output results in JSON format for easy script or agent parsing |