Image Magic provides a nice solution for this both on Windows and Linux (the two environments i use) although they also provide libraries for MAC.
To install on windows first download and install the windows installer for Image Magic.
Note that you will need the installer to include the C libraries as well.
Then proceed to install the RMagick gem by this command (source):
And don't miss any character. just replace the [path to ImageMagic] with the location the installer put the image magic installation.
gem install rmagick -- '--with-opt-dir="[path to ImageMagick]"'
The installation for Ubuntu is slightly easier:
sudo apt-get install imagemagick libmagickcore-dev
sudo apt-get install libmagickwand-dev
sudo gem install rmagick
Once you have the gem installed, add the following line to the gem file:
gem "rmagick", "~> 2.13.1"
And run the following command:
In the files you want to use this gem include:
You may find the instructions for the image manipulation facilities useful as well.