{"id":20721707,"url":"https://github.com/yannickl88/image","last_synced_at":"2025-10-28T12:21:59.666Z","repository":{"id":35208068,"uuid":"216259145","full_name":"yannickl88/image","owner":"yannickl88","description":"Libary for reading, transforming and writing image files","archived":false,"fork":false,"pushed_at":"2024-12-10T19:56:28.000Z","size":2216,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T04:22:41.602Z","etag":null,"topics":["animated","image-processing","php"],"latest_commit_sha":null,"homepage":null,"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/yannickl88.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-19T19:24:22.000Z","updated_at":"2024-12-10T19:56:31.000Z","dependencies_parsed_at":"2022-09-12T04:41:22.599Z","dependency_job_id":null,"html_url":"https://github.com/yannickl88/image","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannickl88%2Fimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannickl88%2Fimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannickl88%2Fimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannickl88%2Fimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yannickl88","download_url":"https://codeload.github.com/yannickl88/image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250457778,"owners_count":21433734,"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":["animated","image-processing","php"],"created_at":"2024-11-17T03:29:05.056Z","updated_at":"2025-10-28T12:21:54.616Z","avatar_url":"https://github.com/yannickl88.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Easy reading, transforming and writing image files using PHP\n----------\n\n[![Latest Version](http://img.shields.io/packagist/v/yannickl88/image.svg?style=flat-square)](https://github.com/yannickl88/image/releases)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/yannickl88/image)\n[![Build Status](https://img.shields.io/travis/yannickl88/image/master.svg?style=flat-square)](https://travis-ci.org/yannickl88/image)\n\nLibrary for reading, transforming and writing image files.\n\nThis libary was born out of the need to have a consistent API for interacting with images. The goal is to have simple methods for common image tasks like cropping and resizing.\n\nUsage\n------------\nSupported file extensions for reading:\n* PNG\n* JPG\n* JPEG\n* GIF\n\nSupported file extension for writing:\n* PNG\n* WEBP (if mod gd has been enabled with WebP support)\n\nExample usages:\n```php\n$image = \\Yannickl88\\Image\\Image::fromFile('/some/image.png');\n\n// Resize to 50 x 50\n$thumbnail = $image-\u003eresize(50, 50);\n$thumbnail-\u003esave('/some/thumbnail.png');\n\n// Fit the image to a width and height of 50, 50 while maintaining it's aspect ratio.\n$thumbnail = $image-\u003efit(50, 50);\n$thumbnail-\u003esave('/some/thumbnail.png');\n\n// Crop at 50, 50 with a square of 100 x 100\n$thumbnail = $image-\u003ecrop([50, 50, 100, 100]);\n$thumbnail-\u003esave('/some/thumbnail.png');\n\n// Resize and crop at the same time\n$thumbnail = $image-\u003esampleTo([50, 50, 100, 100], [0, 0, 50, 50]);\n$thumbnail-\u003esave('/some/thumbnail.png');\n\n// Set the quality, where 0 being low and 1 high (value between 0 and 1)\n$compressed = $image-\u003equality(0.25);\n$compressed-\u003esave('/some/preview.png');\n\n// Get image width\nvar_dump($image-\u003ewidth()); // int\n\n// Get image height\nvar_dump($image-\u003eheight()); // int\n\n// Get image bounding box\nvar_dump($image-\u003erect()); // array(0, 0, width, height)\n\n// Get a color at a given coordinate\nvar_dump($image-\u003ecolor(0, 0)); // array(red, green, blue, alpha)\n\n// Get the image orientation\nvar_dump($image-\u003eorientation()); // ImageInterface::ORIENTATION_LANDSCAPE\n\n// Get the raw data and output it\nheader('Content-type: image/png');\nheader('Content-Disposition: filename=\"image.png\"');\necho $image-\u003edata('.png');\n```\n\nMigration\n------------\nSee [Migration Guide](MIGRATION.md).\n\nInstallation\n------------\n* `$ composer require yannickl88/image`\n* This library follows [semantic versioning](http://semver.org/) strictly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyannickl88%2Fimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyannickl88%2Fimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyannickl88%2Fimage/lists"}