Skip to content

Commit 209b8a1

Browse files
committed
add wand.py
thanks Fred!
1 parent 46f949f commit 209b8a1

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

benchmark.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ fi
160160

161161
benchmark convert "./im.sh $tmp/x.tif $tmp/x2.tif"
162162

163+
benchmark wand.py "./wand.py $tmp/x.tif $tmp/x2.tif"
164+
163165
benchmark econvert "./ei.sh $tmp/x-strip.tif $tmp/x2.tif"
164166

165167
echo -n jpg-

wand.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/python3
2+
3+
from sys import argv
4+
from wand.image import Image
5+
6+
input = argv[1]
7+
output = argv[2]
8+
9+
with Image(filename=input) as img:
10+
img.shave(100,100)
11+
img.resize(round(0.9*img.width), round(0.9*img.height), 'triangle')
12+
img.morphology(method='convolve', kernel='3x3:-1,-1,-1,-1,16,-1,-1,-1,-1')
13+
img.save(filename=output)

0 commit comments

Comments
 (0)