{"id":13519540,"url":"https://github.com/php-imagine/Imagine","last_synced_at":"2025-03-31T13:30:56.457Z","repository":{"id":915890,"uuid":"677602","full_name":"php-imagine/Imagine","owner":"php-imagine","description":"PHP Object Oriented image manipulation library","archived":false,"fork":false,"pushed_at":"2024-08-16T06:28:32.000Z","size":15160,"stargazers_count":4418,"open_issues_count":30,"forks_count":529,"subscribers_count":129,"default_branch":"develop","last_synced_at":"2024-10-29T10:53:32.898Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://imagine.readthedocs.io","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/php-imagine.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2010-05-20T18:39:42.000Z","updated_at":"2024-10-28T13:42:56.000Z","dependencies_parsed_at":"2024-02-18T00:23:54.041Z","dependency_job_id":"baece786-9928-475d-b7fd-c392efe0c6b1","html_url":"https://github.com/php-imagine/Imagine","commit_stats":null,"previous_names":["avalanche123/imagine"],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-imagine%2FImagine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-imagine%2FImagine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-imagine%2FImagine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-imagine%2FImagine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-imagine","download_url":"https://codeload.github.com/php-imagine/Imagine/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240118381,"owners_count":19750484,"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":[],"created_at":"2024-08-01T05:02:00.318Z","updated_at":"2025-03-31T13:30:56.444Z","avatar_url":"https://github.com/php-imagine.png","language":"PHP","funding_links":[],"categories":["PHP","Table of Contents"],"sub_categories":["Globalization"],"readme":"# Imagine\n[![PHPUnit](https://github.com/php-imagine/Imagine/actions/workflows/phpunit.yml/badge.svg)](https://github.com/php-imagine/Imagine/actions/workflows/phpunit.yml)\n[![Coding Style](https://github.com/php-imagine/Imagine/actions/workflows/coding-style.yml/badge.svg)](https://github.com/php-imagine/Imagine/actions/workflows/coding-style.yml)\n\nTweet about it using the [#php_imagine](https://twitter.com/search?q=%23php_imagine) hashtag.\n\nImage manipulation library for PHP inspired by Python's PIL and other image\nlibraries.\n\n## Requirements\n\nThe Imagine library has the following requirements:\n\n - PHP 7.1+\n\nOlder version of the library support also older PHP Version:\n\n - PHP 5.5 - 7.0 use version ^1.3\n - PHP 5.3 - 5.4 use version ^1.2\n\nDepending on the chosen Image implementation, you may need one of the following PHP extensions:\n\n - GD2\n - Imagick (with ImageMagick version 6.2.9 or later, except version 7.0.7-32)\n - Gmagick\n\nTo read EXIF metadata (e.g. for autorotation), activate the PHP ``exif`` extension. This is optional: Imagine works\nwithout the PHP ``exif`` extension, but then it can't read and act on image orientation or other EXIF metadata.\n\n### Installation using composer\n`php composer.phar require imagine/imagine`\n\n## Basic Principles\n\nThe main purpose of Imagine is to provide all the necessary functionality to bring all native low level image processing libraries in PHP to the same simple and intuitive OO API.\n\nSeveral things are necessary to accomplish that:\n\n* Image manipulation tools, such as resize, crop, etc.\n* Drawing API - to create basic shapes and advanced charts, write text on the image\n* Masking functionality - ability to apply black\u0026white or grayscale images as masks, leading to semi-transparency or absolute transparency of the image the mask is being applied to\n\nThe above tools should be the basic foundation for a more powerful set of tools that are called ``Filters`` in Imagine.\n\nSome of the ideas for upcoming filters:\n\n* Charting and graphing filters - pie and bar charts, linear graphs with annotations\n* Reflection - apple style\n* Rounded corners - web 2.0\n\n## Documentation ##\n\n - [Hosted by Read The Docs](http://imagine.readthedocs.org/)\n\n## Presentations ##\n\n - [Introduction to Imagine](http://www.slideshare.net/avalanche123/introduction-toimagine)\n - [How to Take Over the World with Lithium](http://speakerdeck.com/u/nateabele/p/how-to-take-over-the-world-with-lithium?slide=33)\n\n## Articles ##\n\n - [Image Processing with Imagine](http://www.phparch.com/2011/03/image-processing-with-imagine)\n\n## Contributing ##\n\n### Branches\n\nNew pull requests should be based on the `develop` branch.\nThe `master` branch is the stable branch: it usually matches the latest a release but in can be a bit ahead.\n\n### Test groups\n\nSome PHPUnit test is marked as skipped (for example, tests that require a driver that support multiple layers and executed with the GD driver).\nIn addition, if you don't have installed gmagick, the gmagick tests will be marked as skipped.\n\nIf you don't want to run tests that are marked as \"always skipped\" you can tell PHPUnit to exclude the `always-skipped` group.\nThe same for the tests that require a specific driver (`gd`, `imagick`, `imagick`).\n\nSo, for example, to exclude the `always-skipped` and the `gmagick` tests, you can launch phpunit with this command options:\n\n```\ncomposer run test -- --exclude-group always-skipped,gmagick\n```\n\n\n### Development environment\n\nSetting up an environment with all the required libraries may be very hard.\nIn order to run the tests locally, you can use the same [docker images](https://github.com/php-imagine/docker-builder/pkgs/container/test) used by Imagine to test the pull requests.\n\nFor example, if you have Imagine locally in the `/home/me/imagine` folder, you can run tests for PHP 8.1 with the GD and Imagick with this very simple approach:\n\n1. Launch a temporary docker container with:\n   ```sh\n   docker run --rm -it -v /home/me/imagine:/app -w /app ghcr.io/php-imagine/test:8.1-gd-imagick bash\n   ```\n2. Inside the docker container, run these commands:\n   ```sh\n   # Start a local web server: some tests require it\n   cd tests\n   php -n -S 0.0.0.0:8013 \u003e/dev/null 2\u003e\u00261 \u0026\n   cd ..\n   # Tell the tests that the local web server is available at the port 8013\n   export IMAGINE_TEST_WEBSERVERURL=http://localhost:8013\n   # Install the composer dependencies\n   composer update\n   # Run the tests\n   composer run test -- --exclude-group always-skipped,gmagick\n   ```\n\n\u003e Note: This approach works on Windows too: simply launch the docker container with\n\u003e ```\n\u003e docker run --rm -it -v C:\\Path\\To\\Imagine:/app -w /app ghcr.io/php-imagine/test:8.1-gd-imagick bash\n\u003e ```\n\n### Built test files\n\nMany tests create temporary files (in the `tests/tmp` directory) containing built images.\nThose temporary files are compared with expected images, and then are deleted.\nIf you want to keep those temporary files (for example, to check what's being built), you can set the `IMAGINE_TEST_KEEP_TEMPFILES` environment variable.\nIf the `IMAGINE_TEST_KEEP_TEMPFILES` is configured in the GitHub Action tests, those temporary files are attached to tests as an articact.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-imagine%2FImagine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-imagine%2FImagine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-imagine%2FImagine/lists"}