imagettftextblur is a drop in replacement for imagettftext with an added parameter to add blur, glow and shadow effects to your PHP GD images
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.
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:
- Documentation updates
- Added PHPDoc support throughout
- Added descriptive comments throughout library source code
- Fixed a lot of minor PSR-1/PSR-2 errors & warnings
- No new features; we had to do a version bump to fix an issue with our Composer package
- Fixed autoload issue when installed via Composer
- Added Composer support
- 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
- Fixed issue that caused the alpha of colors to be ignored (fixed by @vHeemstra)
- Added PNG images for each example of expected output
- Intial release of imagettftextblur