Install related dependencies
yum install -y gcc libpng libjpeg libpng-devel libjpeg-devel ghostscript libtiff libtiff-devel freetype freetype-devel
Download and unzip
wget ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/1.3/GraphicsMagick-1.3.29.tar.gz tar -zxvf GraphicsMagick-1.3.29.tar.gz
Compile and install
cd /usr/local/GraphicsMagick-1.3.29 ./configure --prefix=/usr/local/GraphicsMagick-1.3.29 make make install
Set environment variables
echo 'PATH=$PATH:$GMAGICK_HOME/bin' > /etc/profile.d/graphicsmagick.sh && source /etc/profile
Check whether the installation is successful
gm version
View the supported image list
gm convert -list formats