imagettftextblur is a drop in replacement for imagettftext with an added parameter to add blur, glow and shadow effects to your PHP GD images.
To get started simply add a reference in your code to imagettftextblur.php and change all calls from imagettftext to imagettftextblur. To add blur simply pass an integer greater than zero as the $blur_intensity parameter.
imagettftext($image, 20, 0, 0, 0, $color, $font, $string); // standard method to add text to a GD image imagettftextblur($image, 20, 0, 0, 0, $color, $font, $string); // this will work the same as the line above imagettftextblur($image, 20, 0, 0, 0, $color, $font, $string, 5); // method to add blurred text to a GD image
There are a number of other examples included in the repository.
This project offers support for the Composer dependency manager. You can find the imagettftextblur package online at https://packagist.org/packages/andrewgjohnson/imagettftextblur.
Install using Composer
Either run this command
composer require andrewgjohnson/imagettftextblur
or add this to the
require section of your composer.json
Please post any questions or problems using the imagettftextblur tag on stackoverflow.com if you need help.
This project was started by Andrew G. Johnson (@andrewgjohnson)
Full list of contributors:
v1.2.6 (November 29, 2016)
- Documentation updates
v1.2.5 (November 29, 2016)
- Added PHPDoc support throughout
- Added descriptive comments throughout library source code
- Fixed a lot of minor PSR-1/PSR-2 errors & warnings
v1.2.4 (November 24, 2016)
- No new features; we had to do a version bump to fix an issue with our Composer package
v1.2.3 (November 24, 2016)
- Fixed autoload issue when installed via Composer
v1.2.2 (November 24, 2016)
- Added Composer support
v1.2.1 (November 24, 2016)
v1.2.0 (November 8, 2016)
- Added new optional parameter called $blur_filter to allow different filters to be used
- Calls to imagettftextblur() with a valid $blur_intensity value now return an array of coordinates based on imagettftext()'s return values
v1.1.0 (April 7, 2016)
- Fixed issue that caused the alpha of colors to be ignored (fixed by @vHeemstra)
- Added PNG images for each example of expected output
v1.0.0 (March 19, 2013)
- Intial release of imagettftextblur