{"id":19544504,"url":"https://github.com/dantsu/php-image-editor","last_synced_at":"2025-04-26T18:30:24.064Z","repository":{"id":40390270,"uuid":"403902726","full_name":"DantSu/php-image-editor","owner":"DantSu","description":"PHP library to easily edit image with GD extension. Resize, crop, merge, draw, and many more options !","archived":false,"fork":false,"pushed_at":"2023-09-25T13:47:58.000Z","size":572,"stargazers_count":32,"open_issues_count":2,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T06:35:19.850Z","etag":null,"topics":["composer","composer-library","composer-package","gd","image","image-editing","image-editor","image-manipulation","php","php-library","php7"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DantSu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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":"DantSu"}},"created_at":"2021-09-07T08:35:22.000Z","updated_at":"2024-12-11T15:27:23.000Z","dependencies_parsed_at":"2024-06-19T19:42:53.349Z","dependency_job_id":"2a17e0d5-8fcc-4398-8ec0-b2f3b39bf4fc","html_url":"https://github.com/DantSu/php-image-editor","commit_stats":{"total_commits":38,"total_committers":5,"mean_commits":7.6,"dds":"0.21052631578947367","last_synced_commit":"59a3e922000767051d380a2c530c61344f1e79ec"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DantSu%2Fphp-image-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DantSu%2Fphp-image-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DantSu%2Fphp-image-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DantSu%2Fphp-image-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DantSu","download_url":"https://codeload.github.com/DantSu/php-image-editor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251035030,"owners_count":21526296,"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","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":["composer","composer-library","composer-package","gd","image","image-editing","image-editor","image-manipulation","php","php-library","php7"],"created_at":"2024-11-11T03:29:18.396Z","updated_at":"2025-04-26T18:30:23.696Z","avatar_url":"https://github.com/DantSu.png","language":"PHP","readme":"[![Packagist](https://img.shields.io/packagist/dt/DantSu/php-image-editor.svg)](https://packagist.org/packages/DantSu/php-image-editor)\n[![Latest Stable Version](https://poser.pugx.org/DantSu/php-image-editor/v/stable)](https://packagist.org/packages/DantSu/php-image-editor)\n[![GitHub license](https://img.shields.io/github/license/DantSu/php-image-editor.svg)](https://github.com/DantSu/php-image-editor/blob/master/LICENSE)\n\n# PHP Image Editor\n\nPHP library to easily edit image with GD extension. Resize, crop, merge, draw, and many more options !\n\n## ✨ Supporting\n\n⭐ Star this repository to support this project. You will contribute to increase the visibility of this library 🙂\n\n## Installation\n\nInstall this library easily with composer :\n\n```cmd\ncomposer require dantsu/php-image-editor\n```\n\n## How to use\n\n### Example 1\n\nCreate a empty image, draw on it and display it :\n\n```php\nuse \\DantSu\\PHPImageEditor\\Image;\n\n\\header('Content-type: image/png');\n\n$image = Image::newCanvas(500, 500)\n    -\u003edrawRectangle(0, 0, 500, 500, '#444')\n    -\u003edrawRectangle(0, 350, 500, 500, '#FF8800')\n    -\u003ewriteText('I got the power !', __DIR__ . '/resources/font.ttf', 40, '#FFFFFF', Image::ALIGN_CENTER, 310)\n    -\u003edrawCircle(25, 100, 100, '#FF8800')\n    -\u003edrawCircle(25, 100, 95, '#000000FF')\n    -\u003edrawCircle(475, 100, 100, '#FF8800')\n    -\u003edrawCircle(475, 100, 95, '#000000FF');\n\nfor($i = 0; $i \u003c= 360; $i+=30) {\n    $image\n        -\u003edrawArrowWithAngle(250, 200, $i, 80, 2, '#FF8800')\n        -\u003edrawArrowWithAngle(250, 200, ($i + 15), 50, 2, '#FF8800');\n}\n\n$image\n    -\u003ecrop(450, 300, Image::ALIGN_CENTER, Image::ALIGN_MIDDLE)\n    -\u003edisplayPNG();\n```\n\n![Sample 1](./src/samples/resources/sample1.png)\n\n\n### Example 2\n\nApply a watermark on a photo and save it :\n\n```php\nuse \\DantSu\\PHPImageEditor\\Image;\n\nImage::fromPath(__DIR__ . '/resources/photo.jpg')\n    -\u003edownscaleAndCrop(1920, 1080, Image::ALIGN_CENTER, Image::ALIGN_BOTTOM)\n    -\u003epasteOn(\n        Image::fromPath(__DIR__ . '/resources/watermark.png')-\u003edownscaleProportion(300, 300),\n        Image::ALIGN_RIGHT,\n        Image::ALIGN_TOP\n    )\n    -\u003esaveJPG(__DIR__ . '/my-image.jpg', 70);\n```\n\n![Sample 2](./src/samples/resources/sample2.jpg)\n\n## Documentation\n\nSee [DantSu\\PHPImageEditor\\Image](./docs/classes/DantSu/PHPImageEditor/Image.md) documentation class for more details.\n\n## Contributing\n\nPlease fork this repository and contribute back using pull requests.\n\nAny contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed.\n\n","funding_links":["https://github.com/sponsors/DantSu"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdantsu%2Fphp-image-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdantsu%2Fphp-image-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdantsu%2Fphp-image-editor/lists"}