Batch Image Transform

Batch geometric transformations (rotate, flip, scale up/down, canvas expand) without altering image content.

meitu batch image-transform

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-transform \
  --input-dir ./images \
  --output-dir ./transformed \
  --rotate 90 \
  --json

# Scenario 2: Config file mode
meitu batch image-transform \
  --config ./batch.image-transform.yaml \
  --output-dir ./transformed \
  --json

Config File Example

version: 1
defaults:
  outputDir: ./transformed
items:
  - input: ./images/img1.jpg
    rotate: 90
    flipX: true
  - input: ./images/img2.jpg
    srNum: 2
    prompt: scale up by 2x

Parameter Reference

ParameterRequiredDescription
--input-dirNoInput directory, recursively scans image files
--output-dirYesOutput directory
--configNoPath to YAML/JSON config file
--concurrencyNoType: number; Default: 3; Number of parallel tasks
--max-retriesNoType: number; Default: 0; Number of retries on failure
--skip-existNoSkip existing output files
--dry-runNoPreview the plan without execution
--no-progressNoDisable per-task progress logging
--jsonNoOutput results in JSON format
--json-outputNoWrite results to a specified JSON file
--skill-nameNoSkill name for server-side attribution
--rotateNoType: number; Rotation angle (-180° to 180°)
--flip-xNoType: boolean; Horizontal flip
--flip-yNoType: boolean; Vertical flip
--sr-numNoType: number; Scale factor (2/4/8)
--target-widthNoType: number; Target width
--target-heightNoType: number; Target height
--widthNoType: number; Width
--heightNoType: number; Height
--promptNoType: string; Transform description