24 November 2021

The code example shows how to read an image from url to Imagick. Imagick doesn't take in url directly, but it has a method for reading file as binary content. So we just need to get the content form url and feed it into Imagick.

Source code viewer
  1. $image = new Imagick();
  2. $image->readImageBlob(file_get_contents($url));
Programming Language: PHP