ImageMagick is a robust collection of tools and libraries to read, write, and manipulate an image in many image formats including popular formats like TIFF, JPEG, PNG, PDF, PhotoCD, and GIF. With ImageMagick you can create images dynamically, making it suitable for Web applications. You can also resize, rotate, sharpen, color reduce, or add special effects to an image or image sequence.
- ImageMagick uses Ghostscript to render Postscript and PDF files, as well as formats where a translator to Postscript is available. ImageMagick will also use the fonts delivered with Ghostscript to support the standard set of Postscript fonts. The installation package includes the ImageMagick.
- Imagick::getVersion — Returns the ImageMagick API version Imagick::haldClutImage — Replaces colors in the image Imagick::hasNextImage — Checks if the object has more images.
ServerPilot cannot provide support for customizations. We always recommend avoiding customizations unless you absolutely need to customize your server. Customizations increase complexity, and complexity often leads to downtime and vulnerabilities.
The ImageMagick extension supports PHP 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, and 7.4.
Imagick: The PHP ImageMagick Extension
The ImageMagick extension, called Imagick when referring to the PHP extension, is a native PHP extension to create and modify images using the ImageMagick API.
Imagemagick Windows
To install this extension, run the following commands as your server's root user:
When prompted with:
just press Enter; do not type a prefix (that is, allow autodetect).
Once installed, create a configuration file for the extension and restart PHP by running the following commands as root:
Using Imagick with PDF Files
Additionally, attempting to work around ImageMagick's PDF security issues by using Ghostscript directly is also dangerous as Ghostscript is also vulnerable to exploitation when processing malicious PDF files.
In order to allow ImageMagick to process PDF files, you must SSH into your server as root and edit the following file:
Locate the line:
Comment out this line by replacing it with the following:
Finally, restart PHP:
Verifying the Installation
Imagemagick Psd
You can verify the ImageMagick extension is installed with this command:
If ImageMagick is installed correctly, you will see the following:
Imagemagick.org
Uninstalling the ImageMagick Extension
To uninstall this extension, as root run the commands:
Imagemagick Choco
Next, restart PHP-FPM with the command: