{"id":19703504,"url":"https://github.com/orbitale/imagemagickphp","last_synced_at":"2026-02-09T15:17:13.084Z","repository":{"id":25143738,"uuid":"28566016","full_name":"Orbitale/ImageMagickPHP","owner":"Orbitale","description":"A PHP wrapper around the ImageMagick binaries","archived":false,"fork":false,"pushed_at":"2024-12-09T17:46:10.000Z","size":526,"stargazers_count":43,"open_issues_count":2,"forks_count":15,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-27T05:35:25.541Z","etag":null,"topics":["application-wrapper","hacktoberfest","imagemagick","oop-interface","php"],"latest_commit_sha":null,"homepage":"http://orbitale.github.io/ImageMagickPHP","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Orbitale.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"pierstoval"}},"created_at":"2014-12-28T16:18:47.000Z","updated_at":"2025-02-25T17:46:27.000Z","dependencies_parsed_at":"2025-01-15T03:54:00.532Z","dependency_job_id":"b2c2f87c-bf05-4ccf-827c-603c334cd146","html_url":"https://github.com/Orbitale/ImageMagickPHP","commit_stats":{"total_commits":208,"total_committers":15,"mean_commits":"13.866666666666667","dds":"0.26442307692307687","last_synced_commit":"4e59f4201d0fbefbeabb4500648837681767b6c2"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/Orbitale/ImageMagickPHP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orbitale%2FImageMagickPHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orbitale%2FImageMagickPHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orbitale%2FImageMagickPHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orbitale%2FImageMagickPHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Orbitale","download_url":"https://codeload.github.com/Orbitale/ImageMagickPHP/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orbitale%2FImageMagickPHP/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267960874,"owners_count":24172509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["application-wrapper","hacktoberfest","imagemagick","oop-interface","php"],"created_at":"2024-11-11T21:18:04.631Z","updated_at":"2026-02-09T15:17:13.055Z","avatar_url":"https://github.com/Orbitale.png","language":"PHP","funding_links":["https://github.com/sponsors/pierstoval"],"categories":[],"sub_categories":[],"readme":"ImageMagickPHP\n===============\n\nAn ImageMagick \"exec\" component for PHP apps.\n\nInstallation\n===============\n\nInstall with [Composer](https://getcomposer.org/), it's the best packages manager you can have :\n\n```shell\ncomposer require orbitale/imagemagick-php\n```\n\nRequirements\n===============\n\n* PHP 7.2 or higher\n* [ImageMagick 7](https://www.imagemagick.org/) has to be installed on your server, and the binaries must be executable by the user running the PHP process.\n\nSettings\n===============\n\nThere are not many settings, but when you instantiate a new `Command` object, you may specify ImageMagick's executable directory directly in the constructor, for example :\n\n```php\nuse Orbitale\\Component\\ImageMagick\\Command;\n\n// Default directory for many Linux distributions\n$command = new Command('/usr/bin/magick');\n\n// Or in Windows, depending of the install directory\n$command = new Command('C:\\ImageMagick\\magick.exe');\n\n// Will try to automatically discover the path of ImageMagick in your system\n// Note: it uses Symfony's ExecutableFinder to find it in $PATH\n$command = new Command();\n```\n\nThe constructor will automatically search for the `magick` executable, test it, and throw an exception if it's not available.\n\n⚠️ Make sure your ImageMagick binary is executable.\n\nUsage\n===============\n\nFirst, we recommend you to note all possible scripts that you can use with ImageMagick in the [official docs](https://imagemagick.org/script/command-line-tools.php):\n\n* [animate](https://imagemagick.org/script/animate.php)\n* [compare](https://imagemagick.org/script/compare.php)\n* [composite](https://imagemagick.org/script/composite.php)\n* [conjure](https://imagemagick.org/script/conjure.php)\n* [convert](https://imagemagick.org/script/convert.php)\n* [display](https://imagemagick.org/script/display.php)\n* [identify](https://imagemagick.org/script/identify.php)\n* [import](https://imagemagick.org/script/import.php)\n* [mogrify](https://imagemagick.org/script/mogrify.php)\n* [montage](https://imagemagick.org/script/montage.php)\n* [stream](https://imagemagick.org/script/stream.php)\n\nThese correspond to the \"legacy binaries\", and you can use them if you are familiar or comfortable with them.\n\nAs of ImageMagick 7, these are not mandatory, but this package is compatible with them.\n\n### Basic image type converter with ImageMagick's basic logo\n\nRead the comments :\n\n```php\nrequire_once 'vendor/autoload.php';\n\nuse Orbitale\\Component\\ImageMagick\\Command;\n\n// Create a new command\n$command = new Command();\n\n$response = $command\n    // The command will search for the \"logo.png\" file. If it does not exist, it will throw an exception.\n    // If it does, it will create a new command with this source image.\n    -\u003econvert('logo.png')\n\n    // The \"output()\" method will append \"logo.gif\" at the end of the command-line instruction as a filename.\n    // This way, we can continue writing our command without appending \"logo.gif\" ourselves.\n    -\u003eoutput('logo.gif')\n\n    // At this time, the command shall look like this :\n    // $ \"{ImageMagickPath}convert\" \"logo.png\" \"logo.gif\"\n\n    // Then we run the command by using \"exec()\" to get the CommandResponse\n    -\u003erun()\n;\n\n// Check if the command failed and get the error if needed\nif ($response-\u003ehasFailed()) {\n    throw new Exception('An error occurred:'.$response-\u003egetError());\n} else {\n    // If it has not failed, then we simply send it to the buffer\n    header('Content-type: image/gif');\n    echo file_get_contents('logo.gif');\n}\n```\n\n### Resizing an image\n\n```php\nrequire_once 'vendor/autoload.php';\n\nuse Orbitale\\Component\\ImageMagick\\Command;\n\n// Create a new command\n$command = new Command();\n\n$response = $command\n\n    -\u003econvert('background.jpeg')\n    \n    // We'll use the same output as the input, therefore will overwrite the source file after resizing it.\n    -\u003eoutput('background.jpeg')\n\n    // The \"resize\" method allows you to add a \"Geometry\" operation.\n    // It must fit to the \"Geometry\" parameters in the ImageMagick official documentation (see links below \u0026 phpdoc)\n    -\u003eresize('50x50')\n\n    -\u003erun()\n;\n\n// Check if the command failed and get the error if needed\nif ($response-\u003ehasFailed()) {\n    throw new Exception('An error occurred:'.$response-\u003egetError());\n} else {\n    // If it has not failed, then we simply send it to the buffer\n    header('Content-type: image/gif');\n    echo file_get_contents('logo.gif');\n}\n```\n\n### Currently supported options:\n\nThere are **a lot** of command-line options, and each have its own validation system.\n \nThis is why a \"few\" ones are implemented now, to make sure validation is possible for each of them.\n\n**Note:** If an option is not implemented in the `Command` class, you can create an issue or make a Pull Request that implements the new option!\n\n* [`-annotate`](http://www.imagemagick.org/script/command-line-options.php#annotate)\n* [`-background`](http://www.imagemagick.org/script/command-line-options.php#background)\n* [`-blur`](http://www.imagemagick.org/script/command-line-options.php#blur)\n* [`-colorspace`](http://www.imagemagick.org/script/command-line-options.php#colorspace)\n* [`-crop`](http://www.imagemagick.org/script/command-line-options.php#crop)\n* [`-depth`](http://www.imagemagick.org/script/command-line-options.php#depth)\n* [`-draw`](http://www.imagemagick.org/script/command-line-options.php#draw)\n* [`-extent`](http://www.imagemagick.org/script/command-line-options.php#extent)\n* [`-fill`](http://www.imagemagick.org/script/command-line-options.php#fill)\n* [`-flatten`](http://www.imagemagick.org/script/command-line-options.php#flatten)\n* [`-font`](http://www.imagemagick.org/script/command-line-options.php#font)\n* [`-gaussian-blur`](http://www.imagemagick.org/script/command-line-options.php#gaussian-blur)\n* [`-gravity`](http://www.imagemagick.org/script/command-line-options.php#gravity)\n* [`-interlace`](http://www.imagemagick.org/script/command-line-options.php#interlace)\n* [`-monochrome`](http://www.imagemagick.org/script/command-line-options.php#monochrome)\n* [`-pointsize`](http://www.imagemagick.org/script/command-line-options.php#pointsize)\n* [`-quality`](http://www.imagemagick.org/script/command-line-options.php#quality)\n* [`-resize`](http://www.imagemagick.org/script/command-line-options.php#resize)\n* [`-rotate`](http://www.imagemagick.org/script/command-line-options.php#rotate)\n* [`-size`](http://www.imagemagick.org/script/command-line-options.php#size)\n* [`-strip`](http://www.imagemagick.org/script/command-line-options.php#strip)\n* [`-stroke`](http://www.imagemagick.org/script/command-line-options.php#stroke)\n* [`-thumbnail`](http://www.imagemagick.org/script/command-line-options.php#thumbnail)\n* [`-transpose`](http://www.imagemagick.org/script/command-line-options.php#transpose)\n* [`-transverse`](http://www.imagemagick.org/script/command-line-options.php#transverse)\n* [`xc:`](http://www.imagemagick.org/Usage/canvas/)\n\nFeel free to ask/create an issue if you need more!\n\n### Some aliases that do magic for you:\n\n* `$command-\u003etext()`:\nThis method uses multiple options added to the `-annotate` one to generate a text block.\nYou must specify its position and size, but you can specify color and the font file used.\n\n* `$command-\u003eellipse()`: (check source code for the heavy prototype!)\nThis method uses the `-stroke`, `-fill` and `-draw` options to create an ellipse/circle/disc on your picture.\n**Note:** I recommend to check both the source code and the documentation to be sure of what you are doing.\n\nUseful links\n===============\n\n* ImageMagick official website: http://www.imagemagick.org\n* ImageMagick documentation:\n    * [Installation of the binaries](https://www.imagemagick.org/script/download.php) (depending on your OS and/or distribution)\n    * [Geometry option](https://www.imagemagick.org/script/command-line-processing.php#geometry) (to resize or place text)\n    * [All command-line options](https://imagemagick.org/script/command-line-options.php) ; they're not all available in this tool for now, so feel free to make a PR ! ;)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitale%2Fimagemagickphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbitale%2Fimagemagickphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitale%2Fimagemagickphp/lists"}