#!/bin/bash
dir="/posix/path/to/folder"
cd "$dir"
color1 = "#816c51"
color2 = "#5a4a3b"
color3 = "#1c110f"
for file in *.tiff
do
base=${file%*.tif}
convert -unsharp 5 "$base" "$base.ppm"
convert -opaque white -fill white -fuzz 10% "$base.ppm" "${base}_step1.tif"
convert -fuzz 5% -fill "$color1" -opaque "$color1" "${base}_step1.tif" "${base}_step2.tif"
convert -fuzz 1.5% -fill "$color1" -opaque "$color2" "${base}_step2.tif" "${base}_step3.tif"
convert -fuzz 12% -fill "black" -opaque "$color3" "${base}_step3.tif" "${base}_step4.tif"
convert "${base}_step4.tif" "${base}_final.tif"
done
我得到了幾個錯誤:ImageMagick的bash腳本不工作
convert: unable to open image ...
convert: missing an image filename
test.sh: line 6: color1: command not found
我會很感激一些幫助!謝謝!
'COLOR1:命令不found' - 除去各處'='的空間。 – 2012-01-08 20:26:30
而且,除了ruakh的帖子,在'轉換-unsharp 5 「$基地」 「$ base.ppm」',你可能想' 「$文件」''沒有 「$基地」'作爲第一個文件ARG。 – 2012-01-08 20:31:16