I needed a newer version of ImageMagick than is available on the yum packages on Amazon Linux. I tried using the remi repo but it failed with dependency errors. Here is what I did to install ImageMagick with support for PNG, JPG, and TIFF.
download the most recent package
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
uncomress the package
tar -vxf ImageMagick.tar.gz
install the devel packages for png, jpg, tiff. these are dependencies of ImageMagick
sudo yum -y install libpng-devel libjpeg-devel libtiff-devel
configure ImageMagick without X11. this is a server without a display (headless) so we don't need X11
cd ImageMagick
./configure --without-x
make && make install
mission complete.
Not exactly helping people who insist on ImageMagick, but still may help someone reaching this thread:
I use GraphicsMagick npm pkg with ImageMagick for resizing and converting images in Elastic Beanstalk nodejs.
Locally on macos the code successfully resizes/converts jpg, png, webp formats.
Same code deployed on AWS Elastic Beanstalk: JPEG/PNG formats convert successfully, however WEBP images are identified as PAM images, essentially breaking the ability to resize/convert them.
I consulted AWS support and eventually discovered a work around: dropping GM's ImageMagick mode
.subClass({imageMagick: true}
and not installing ImageMagick. After that, my nodejs instance worked correctly will the mentioned image formats.