mehrfach genutzte imagemagic Parameter zentral definiert
This commit is contained in:
parent
2fdf81df0f
commit
9d9a002075
1 changed files with 3 additions and 3 deletions
|
@ -7,15 +7,15 @@ export OH=$4
|
|||
W=$5
|
||||
if [ "$OW" == "" ]; then OW=0; fi
|
||||
if [ "$OH" == "" ]; then OH=0; fi
|
||||
OPTIONS="-resize $W -set depth 8 -set colorspace RGB"
|
||||
|
||||
#initial conversion
|
||||
convert-im6 -resize $W $INPUT txt:- | awk -v ow=$OW -v oh=$OH 'match($0, /^(.*),(.*):.*#(.{6})/, arr ){ print "PX " arr[1]+ow " " arr[2]+oh " " arr[3] }' > $OUTPUT
|
||||
convert-im6 $OPTIONS $INPUT txt:- | awk -v ow=$OW -v oh=$OH 'match($0, /^([0-9]*),([0-9]*):.*#([0-9A-Fa-f]{6,8}) +r/, arr ){ print "PX " arr[1]+ow " " arr[2]+oh " " arr[3] }' > $OUTPUT
|
||||
|
||||
echo optimizing >&2
|
||||
|
||||
# edge detection
|
||||
#convert-im6 -resize $W $INPUT -negate -edge 6 -negate txt:- | awk -v ow=$OW -v oh=$OH 'match($0, /^(.*),(.*):.*#000000/, arr ){ print "PX " arr[1]+ow " " arr[2]+oh " " }' > /tmp/px6_optimize
|
||||
convert-im6 -resize $W $INPUT -edge 6 -negate txt:- | awk -v ow=$OW -v oh=$OH 'match($0, /^(.*),(.*):.*#000000/, arr ){ print "PX " arr[1]+ow " " arr[2]+oh " " }' > /tmp/px6_optimize
|
||||
convert-im6 $OPTIONS $INPUT -negate -edge 4 -negate txt:- | awk -v ow=$OW -v oh=$OH 'match($0, /^([0-9]*),([0-9]*):.*#000000/, arr ){ print "PX " arr[1]+ow " " arr[2]+oh " " }' > /tmp/px6_optimize
|
||||
grep -Ff /tmp/px6_optimize $OUTPUT > ${OUTPUT}.tmp
|
||||
grep -Ff /tmp/px6_optimize $OUTPUT >> ${OUTPUT}.tmp
|
||||
grep -Ff /tmp/px6_optimize $OUTPUT >> ${OUTPUT}.tmp
|
||||
|
|
Loading…
Add table
Reference in a new issue