Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ available everywhere.
python3 -m venv ~/vips
. ~/vips/bin/activate
pip install pyvips Pillow-SIMD gdlib
gem install rmagick ruby-vips image_science
gem install rmagick mini_magick ruby-vips image_science
```

Then run the driver script:
Expand Down
2 changes: 2 additions & 0 deletions benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ benchmark pnm "./netpbm.sh $tmp/x-strip.tif $tmp/x2.tif"

benchmark rmagick "./rmagick.rb $tmp/x.tif $tmp/x2.tif"

benchmark mini_magick "./mini_magick.rb $tmp/x.tif $tmp/x2.tif"

# this needs careful config, see
# https://github.com/jcupitt/vips-bench/issues/4
YMAGINE=/home/john/ymagine
Expand Down
16 changes: 16 additions & 0 deletions mini_magick.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby

# gem install mini_magick

require 'rubygems'
require 'mini_magick'

im = MiniMagick::Image.open(ARGV[0])

im = im.shave('100x100')
# Triangle is bilinear for small size changes
im = im.filter('Triangle').resize("#{im.width * 0.9}x#{im.height * 0.9}")
kernel = [-1, -1, -1, -1, 16, -1, -1, -1, -1]
im = im.convolve(kernel.join(','))

im.write(ARGV[1])
11 changes: 11 additions & 0 deletions try.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ sleep 2
time ./rmagick.rb wtc_tiled_small.tif x.tif
sleep 2

echo mini_magick.rb

time ./mini_magick.rb wtc_tiled_small.tif x.tif
sleep 2
time ./mini_magick.rb wtc_tiled_small.tif x.tif
sleep 2
time ./mini_magick.rb wtc_tiled_small.tif x.tif
sleep 2
time ./mini_magick.rb wtc_tiled_small.tif x.tif
sleep 2

echo vips.py

time ./vips.py wtc_tiled_small.tif x.tif
Expand Down