Batch Text Replacement in Images
Batch replace text content on images. Supports standard printed text as well as decorative, handwritten, and stylized complex text replacement.
meitu batch image-text-replace
Note: Batch processing is available from meitu-cli v2.1.1 onward. Please upgrade if you're on an older version.
Usage Examples
# Scenario 1: Directory scan mode
meitu batch image-text-replace \
--input-dir ./images \
--output-dir ./edited \
--source-words "old text" \
--target-words "new text" \
--json
# Scenario 2: Config file mode
meitu batch image-text-replace \
--config ./batch.image-text-replace.yaml \
--output-dir ./edited \
--jsonConfig File Example
version: 1
defaults:
outputDir: ./edited
items:
- input: ./images/banner1.jpg
sourceWords: original price 100
targetWords: now 50
- input: ./images/poster1.jpg
prompt: change the date to January 1, 2024Parameter Reference
| Parameter | Required | Description |
|---|---|---|
--input-dir | No | Input directory, recursively scans image files |
--output-dir | Yes | Output directory |
--config | No | Path to YAML/JSON config file |
--concurrency | No | Type: number; Default: 3; Number of parallel tasks |
--max-retries | No | Type: number; Default: 0; Number of retries on failure |
--skip-exist | No | Skip existing output files |
--dry-run | No | Preview the plan without execution |
--no-progress | No | Disable per-task progress logging |
--json | No | Output results in JSON format |
--json-output | No | Write results to a specified JSON file |
--skill-name | No | Skill name for server-side attribution |
--source-words | No | Type: string; Source text to replace |
--target-words | No | Type: string; Target replacement text |
--prompt | No | Type: string; Text replacement description |