bash
python scripts/batch_image.py compress /path/to/images --quality 85
bash
# 固定宽度,高度等比缩放
python scripts/batch_image.py resize /path/to/images --width 800
# 固定高度
python scripts/batch_image.py resize /path/to/images --height 600
# 固定宽高(裁剪或填充)
python scripts/batch_image.py resize /path/to/images --width 800 --height 600 --mode crop
bash
# 文字水印
python scripts/batch_image.py watermark /path/to/images --text "©养虾记" --position bottom-right --opacity 0.5
# 图片水印(Logo)
python scripts/batch_image.py watermark /path/to/images --logo /path/to/logo.png --position center --opacity 0.3
bash
# PNG转JPG
python scripts/batch_image.py convert /path/to/images --format jpg --quality 90
# 转WEBP(更小体积)
python scripts/batch_image.py convert /path/to/images --format webp
bash
# 序号重命名
python scripts/batch_image.py rename /path/to/images --prefix "photo_" --start 1
# 日期重命名
python scripts/batch_image.py rename /path/to/images --date-format "%Y%m%d_%H%M%S"
参数说明默认值--quality压缩质量(1-100)85--width目标宽度---height目标高度---mode调整模式(scale/crop/fill)scale--text水印文字---logo水印图片路径---position水印位置bottom-right--opacity水印透明度(0-1)0.5--format目标格式(png/jpg/webp/gif)jpg--output输出目录./output--prefix重命名前缀""--start重命名起始序号1
top-left:左上角top-right:右上角bottom-left:左下角bottom-right:右下角center:居中tile:平铺text
处理完成!
输入目录:/Users/xxx/images
输出目录:/Users/xxx/images/output
处理图片:25张
总耗时:3.2秒
原始大小:125.6 MB → 处理后:32.4 MB(压缩74%)
出品: AISoBrand|爱索品牌 — AI搜索优化工具
免费检测你的品牌在AI搜索中有没有存在感 → 30秒出结果