{"id":19250272,"url":"https://github.com/charcoalphp/image","last_synced_at":"2026-06-10T23:31:20.159Z","repository":{"id":37491904,"uuid":"505906250","full_name":"charcoalphp/image","owner":"charcoalphp","description":"[READ-ONLY] Image manipulation library for PHP","archived":false,"fork":false,"pushed_at":"2024-03-13T15:05:17.000Z","size":25756,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-30T15:34:50.821Z","etag":null,"topics":["image-processing","imagemagick","imagickphp","php","read-only-repository"],"latest_commit_sha":null,"homepage":"https://github.com/charcoalphp/charcoal","language":"PHP","has_issues":false,"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/charcoalphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2022-06-21T15:44:21.000Z","updated_at":"2022-06-21T16:43:18.000Z","dependencies_parsed_at":"2024-01-13T04:49:51.821Z","dependency_job_id":"b5e0b25d-80cf-4686-bde1-d30df58aaf42","html_url":"https://github.com/charcoalphp/image","commit_stats":{"total_commits":114,"total_committers":10,"mean_commits":11.4,"dds":0.368421052631579,"last_synced_commit":"d19c491be995aa1a9f6f4a8ba9b72f781b5cdafb"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/charcoalphp/image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charcoalphp%2Fimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charcoalphp%2Fimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charcoalphp%2Fimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charcoalphp%2Fimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charcoalphp","download_url":"https://codeload.github.com/charcoalphp/image/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charcoalphp%2Fimage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34175887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"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":["image-processing","imagemagick","imagickphp","php","read-only-repository"],"created_at":"2024-11-09T18:16:41.076Z","updated_at":"2026-06-10T23:31:18.900Z","avatar_url":"https://github.com/charcoalphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Charcoal Image\n==============\n\nThe Image package provides a consistent API for image manipulation and processing\nwith integrations for ~GD~ (coming soon) and ImageMagick (via the PHP extension or via shell commands).\n\n## Installation\n\n```shell\ncomposer require charcoal/image\n```\n\n## Overview\n\n### Why another PHP image libary?\n\n_Why not?_. Charcoal Image has been developped and used in in-house projects for almost 10 years. It has recently been rewritten to a more modern PHP style and released under an open-source license (MIT).\n\nThe main differences between existing PHP libraries like _Imagine_ or _Intervention_ are:\n\n* Effect parameters are sent as an array.\n  * Is it `blur($sigma, $radius)` or `blur($radius, $sigma)`?\n  * With charcoal image it's constant: `blur([ 'radius' =\u003e $radius, 'sigma' =\u003e $sigma ]);`\n* It supports *ImageMagick* binaries\n  * It seems to be a pretty common setup where Imagemagick is installed on a server, but the _Imagick_ PHP library is not.\n* No external dependencies, except the tiny [charcoal/factory].\n\n## Usage\n\nTypically, the Image package is used to load an image, perform operations (called _effects_ such as blur, resize, watermark, etc.) and write the modified image.\n\n### With `setData()`\n\nAll effects can be added at once in a single array.\n\n```php\n$img = new Charcoal\\Image\\Imagick\\ImagickImage();\n\n$img-\u003esetData([\n    'source'  =\u003e 'example.png',\n    'target'  =\u003e 'example-modified.png',\n    'effects' =\u003e [\n        [\n            'type'  =\u003e 'resize',\n            'width' =\u003e 600,\n        ],\n        [\n            'type'  =\u003e 'blur',\n            'mode'  =\u003e 'gaussian',\n            'sigma' =\u003e 5,\n        ],\n    ],\n]);\n$img-\u003eprocess();\n$img-\u003esave();\n```\n\n\u003e `setData()` is perfect for scenario where the effects are from a JSON configuration structure, for example.\n\n### With magic methods\n\nAll effects can also be used as methods on the image (using `__call()` magic).\n\n```php\nuse Charcoal\\Image\\Imagick\\ImagickImage as Image;\n\n$img = new Image();\n$img-\u003eopen('example.png');\n$img-\u003eresize([\n    'width' =\u003e 600\n]);\n$img-\u003eblur([\n    'mode'  =\u003e 'gaussian',\n    'sigma' =\u003e 5\n]);\n$img-\u003esave();\n```\n\n#### Chainable version\n\nAlso shown: using the `ImageFactory` constructor method:\n\n```php\nuse Charcoal\\Image\\ImageFactory;\n\n$factory = new ImageFactory();\n$img = $factory-\u003ecreate('imagemagick');\n$img-\u003eopen('example.png')\n    -\u003eresize([\n        'mode'   =\u003e 'best_fit',\n        'width'  =\u003e 350,\n        'height' =\u003e 350,\n    ])\n    -\u003erotate([\n        'angle' =\u003e 90,\n    ])\n    -\u003emodulate([\n        'luminance' =\u003e 50,\n    ])\n    -\u003esave('modified-target.png');\n```\n\nAvailable effects and operations are documented in the [API Documentation](docs/api.md).\n\n### Available image drivers\n\nThere are currently only 2 available drivers:\n\n* `imagick`\n  * The imagick driver use the `Imagick` PHP extension, which is build on top of imagemagick.\n* `imagemagick`\n  * The imagemagick driver uses the imagmagick binaries directly, running the operations in a separate shell process instead of directely within PHP.\n  * The commands `convert`, `mogrify` and `identify` should be installed on the system and reachable from the PHP process.\n\n\u003e 👉 Comming soon, the `gd` driver to use PHP builtin's image capacity.\n\n### How to select a driver\n\nThere are two different ways to instantiate an _Image_ object for a specific driver.\n\nDirectly:\n\n```php\n$img = new Charcoal\\Image\\Imagick\\ImagickImage();\n// or\n$img = new Charcoal\\Image\\Imagemagick\\ImagemagickImage();\n```\n\nWith the provided `ImageFactory`:\n\n```php\nuse Charcoal\\Image\\ImageFactory;\n\n$factory = new ImageFactory();\n\n$img = $factory-\u003ecreate('imagick');\n// or\n$img = $factory-\u003ecreate('imagemagick');\n```\n\n## Resources\n\n* [Contributing](https://github.com/charcoalphp/.github/blob/main/CONTRIBUTING.md)\n* [Report issues](https://github.com/charcoalphp/charcoal/issues) and\n  [send pull requests](https://github.com/charcoalphp/charcoal/pulls)\n  in the [main Charcoal repository](https://github.com/charcoalphp/charcoal)\n\n[charcoal/factory]: https://github.com/charcoalphp/factory\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharcoalphp%2Fimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharcoalphp%2Fimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharcoalphp%2Fimage/lists"}