[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8395":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},8395,"Imagine","php-imagine\u002FImagine","php-imagine","PHP Object Oriented image manipulation library","https:\u002F\u002Fimagine.readthedocs.io",null,"PHP",4475,530,128,26,0,1,3,30.18,"Other",false,"develop",[],"2026-06-12 02:01:53","# Imagine\n[![PHPUnit](https:\u002F\u002Fgithub.com\u002Fphp-imagine\u002FImagine\u002Factions\u002Fworkflows\u002Fphpunit.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fphp-imagine\u002FImagine\u002Factions\u002Fworkflows\u002Fphpunit.yml)\n[![Coding Style](https:\u002F\u002Fgithub.com\u002Fphp-imagine\u002FImagine\u002Factions\u002Fworkflows\u002Fcoding-style.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fphp-imagine\u002FImagine\u002Factions\u002Fworkflows\u002Fcoding-style.yml)\n\nTweet about it using the [#php_imagine](https:\u002F\u002Ftwitter.com\u002Fsearch?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\u002Fimagine`\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&white 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:\u002F\u002Fimagine.readthedocs.org\u002F)\n\n## Presentations ##\n\n - [Introduction to Imagine](http:\u002F\u002Fwww.slideshare.net\u002Favalanche123\u002Fintroduction-toimagine)\n - [How to Take Over the World with Lithium](http:\u002F\u002Fspeakerdeck.com\u002Fu\u002Fnateabele\u002Fp\u002Fhow-to-take-over-the-world-with-lithium?slide=33)\n\n## Articles ##\n\n - [Image Processing with Imagine](http:\u002F\u002Fwww.phparch.com\u002F2011\u002F03\u002Fimage-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:\u002F\u002Fgithub.com\u002Fphp-imagine\u002Fdocker-builder\u002Fpkgs\u002Fcontainer\u002Ftest) used by Imagine to test the pull requests.\n\nFor example, if you have Imagine locally in the `\u002Fhome\u002Fme\u002Fimagine` 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 \u002Fhome\u002Fme\u002Fimagine:\u002Fapp -w \u002Fapp ghcr.io\u002Fphp-imagine\u002Ftest: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 >\u002Fdev\u002Fnull 2>&1 &\n   cd ..\n   # Tell the tests that the local web server is available at the port 8013\n   export IMAGINE_TEST_WEBSERVERURL=http:\u002F\u002Flocalhost: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> Note: This approach works on Windows too: simply launch the docker container with\n> ```\n> docker run --rm -it -v C:\\Path\\To\\Imagine:\u002Fapp -w \u002Fapp ghcr.io\u002Fphp-imagine\u002Ftest:8.1-gd-imagick bash\n> ```\n\n### Built test files\n\nMany tests create temporary files (in the `tests\u002Ftmp` 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","Imagine 是一个面向对象的 PHP 图像处理库，受到 Python 的 PIL 和其他图像库的启发。它提供了包括调整大小、裁剪、绘制图形和文本等核心功能，并支持使用 GD2、Imagick 或 Gmagick 作为底层图像处理引擎。此外，通过其直观的 API，Imagine 还能够实现图像遮罩以及一系列高级滤镜效果，如图表生成、反射和圆角处理。该库适用于需要在 PHP 应用中进行图像处理的各种场景，比如网站内容管理系统、电子商务平台或任何需要动态生成或修改图片的应用程序。",2,"2026-06-11 03:17:42","top_language"]