批量图片改字

批量替换图片上的文字内容,支持标准印刷体和花字/手写/风格化复杂改字。

meitu batch image-text-replace

注意:批量处理功能自 meitu-cli 2.1.1 起开始支持,低版本请先升级后再使用。

使用示例

# 场景一:目录扫描模式
meitu batch image-text-replace \
  --input-dir ./images \
  --output-dir ./edited \
  --source-words "旧文字" \
  --target-words "新文字" \
  --json

# 场景二:配置文件模式
meitu batch image-text-replace \
  --config ./batch.image-text-replace.yaml \
  --output-dir ./edited \
  --json

配置文件示例

version: 1
defaults:
  outputDir: ./edited
items:
  - input: ./images/banner1.jpg
    sourceWords: 原价100
    targetWords: 现价50
  - input: ./images/poster1.jpg
    prompt: 将日期改为2024年1月1日

参数说明

参数必需说明
--input-dir输入目录,递归扫描图片文件
--output-dir输出目录
--configYAML/JSON 配置文件路径
--concurrency类型:number;默认:3;并行执行数量
--max-retries类型:number;默认:0;失败重试次数
--skip-exist跳过已存在的输出文件
--dry-run仅预览计划,不执行
--no-progress禁用逐个任务的进度日志
--json以 JSON 格式输出结果
--json-output将结果写入指定 JSON 文件
--skill-name服务端归属的技能名称
--source-words类型:string;原文字
--target-words类型:string;目标文字
--prompt类型:string;改字描述