Search code examples
ruby-on-railsrubylinuximagemagickminimagick

Which is fast? Using minimagick gem in ruby or using direct system call convert (ImageMagick) in linux


I am using a freescale board with low processing capacity. I need to resize images of various sizes into 800x480 pixels. I had used imagemagick to resize it through direct system call. System is taking a lot of time to convert large images. I thought of using minimagick since ruby is also installed in my system for other purposes. I need some advice on the performance of using minimagick( I know Rmagic is slow).

Summary:

1) bash$ convert image1.jpg -resize 800x480 image2.jpg

2) ruby miniconvert.rb

where miniconvert.rb is

require 'mini_magick'
image = MiniMagick::Image.open("image1.jpg") 
image.resize "800X480"
image.write("image2.jpg")

Which will run faster on a single core low cpu machine with minimal linux installed? Also, Is minimagick directly using system call (ie, calling convert of imagemagick)?


Solution

  • It doensn't matter much, because MiniMagick uses the command line tool of ImageMagick as well, according to its Readme (it uses mogrify instead of convert).

    So… the gem is probably more convenient, the command line probably just a bit faster (no overhead).