PURPOSE
The purpose of this page is to install RMagick on Windows. I have installed RMagick on Windows 7 and 10.
RMagick is a special in the following points.
- Using a native code by C language.
- Using ImageMagick. ImageMagick is a image editing software.
So, you will need to:
- Setup DEVELOPMENT KIT.
- Install ImageMagick.
PROCEDURE
1. Setup DEVELOPMENT KIT
You don't know details, please read here.
2. Install ImageMagick
- You must be careful to choose a version.--RMagick 2.16.0 is not support ImageMagick 7, you must install ImageMagick 6.
- To use the dll version, static version can not be used.
- x86 / x64 will be selected in accordance with the Ruby environment.
- Such as Q8 / Q16 is anything good.
- To download the ImageMagick 6 will choose the old binary, which is put under the binaries directory of ImageMagick official site.
- http://www.imagemagick.org/download/binaries/
- ImageMagick the Download page is here: ImageMagick: Install from Binary Distribution
- During the installation, the following selection in the screen of Select Addtional Tasks.
- Add application directory to your system path
- Install development headers and libraries for C and C++
3. Set environment variables
When RMagick compilation, through the path to ImageMagick of include files and library files are visible.
- CPATH = {ImageMagick install directory}/include
- LIBRARY_PATH = {ImageMagick install directory}/lib
4. Install RMagick
Run the following command to install the RMagick.
gem install rmagick
This command will do the following:
- Download RMagick
- Compilation by DEVELOPMENT KIT
- Install
If this does not work, please refer to the TROUBLESHOOTING.
5. Verify RMagick installation
This command will do the following:
gem list --local rmagick
Please make sure that it is output as follows.
*** LOCAL GEMS *** rmagick (X.X.X)
Run the following command, let's make sure that RMagick runs.
ruby -e "require 'rmagick';puts Magick::colors"
It is okay if the output is a list of colors as follow.
name=AliceBlue, compliance=AllCompliance, color.red=61680.5, color.green=63736.5, color.blue=65535.5, color.opacity=0 name=AntiqueWhite, compliance=AllCompliance, color.red=64250.5, color.green=60395.5, color.blue=55255.5, color.opacity=0 name=AntiqueWhite1, compliance=X11Compliance, color.red=65535.5, color.green=61423.5, color.blue=56283.5, color.opacity=0 name=AntiqueWhite2, compliance=X11Compliance, color.red=61166.5, color.green=57311.5, color.blue=52428.5, color.opacity=0 ...
TROUBLESHOOTING
Choose a ImageMagick version
When the bad version combination of ImageMagick an RMagick, you may not be able to install.
Please refer to the following.
RMagick | ImageMagick | bit | rlt | date | reporter |
2.13.2 | 6.5.6-8-Q8-windows-dll | 32 | ○ | - | |
2.13.2 | 6.8.0-3-Q16-windows-x64-dll | 64 | × | - | |
2.13.2 | 6.8.0-4-Q16-windows-dll | 32 | ○ | - | |
2.13.2 | 6.8.2-4-Q16-x86-dll.exe | 32 | × | 2013/02/02 | |
2.13.2 | 6.8.2-4-Q16-x64-dll | 64 | × | 2013/02/02 | |
2.13.2 | 6.8.5-8-Q8-x86-dll | 32 | ○ | 2013/05/30 | |
2.13.2 | 6.8.5-8-Q16-x86-dll | 32 | ○ | 2013/05/30 | |
2.13.2 | 6.8.5-9-Q16-x86-dll | 32 | ○ | 2014/01/20 | passerby |
2.13.2 | 6.8.7-0-Q16-x86-dll | 32 | ○ | 2014/01/20 | passerby |
2.13.2 | 6.8.7-1-Q16-x86-dll | 32 | ○ | 2014/01/20 | passerby |
2.13.2 | 6.8.7-5-Q16-x86-dll | 32 | ○ | 2014/01/20 | passerby |
2.13.2 | 6.8.7-6-Q16-x86-dll | 32 | ○ | 2014/01/20 | passerby |
2.13.2 | 6.8.7-7-Q16-x86-dll | 32 | ○ | 2014/01/20 | passerby |
2.13.2 | 6.8.7-8-Q16-x86-dll | 32 | ○ | 2014/01/20 | passerby |
2.13.2 | 6.8.7-9-Q16-x86-dll | 32 | × | 2014/01/20 | passerby |
2.13.2 | 6.8.7-10-Q16-x86-dll | 32 | × | 2014/01/20 | passerby |
2.13.2 | 6.8.8-0-Q16-x86-dll | 32 | × | 2014/01/20 | passerby |
2.13.4 | 6.9.0-4-Q16-x64-dll | 64 | ○ | 2015/01/27 | |
2.16.0 | 7.0.3-1-Q16-x86-dll | 32 | × | 2016/09/29 | |
2.16.0 | 6.9.5-10-Q8-x86-dll | 32 | ○ | 2016/09/29 | |
2.16.0 | 6.9.6-3-Q16-HDRI-x64-dll | 64 | ○ | 2016/11/01 | |
2.16.0 | 6.9.8-2-Q8-x64-dll | 64 | 〇 | 2017/3/23 | ma |
2.16.0 | 6.9.8-4 Q16 | armv7l | 〇 | 2017/5/8 | z.kangaroo |
2.16.0 | 7.0.5-5 | armv7l | × | 2017/5/8 | z.kangaroo |
It is performance reporting welcome. Please write a comment.
Supplemental: About Q8/Q16, x86/x64, dll/static
First of all, The difference of Q8/Q16 is the number of internal representation bit of color in ImageMagick.
Q8 | 8 bits to each element of the RGB |
---|---|
Q16 | 16 bits to each element of the RGB |
If there is no special requirements, I think that may be the Q16.
Then the difference of x86/x64 is whether the 32-bit(x86) version or a 64-bit(x64) version. Please according to the Ruby environment that you are using.
Even in the OS is 64-bit, if you are using the 32-bit Ruby will use for the 32-bit ImageMagick.
Finally the difference of dll/static is whether you can use the functions of the ImageMagick from outside.
dll | Functions from the outside available |
---|---|
static | Functions from the outside is not available |
Always use the dll when using RMagick.
REFERENCE
RELATION
- Japanese version of this article.
COMMENT
Comments here.
No comment. Comments/rmagick/howtoinstall/windows/en