|Ratings|| ||Unique User Downloads|| ||Download Rankings|
| 74%||Total: 267 ||All time: 7,661 This week: 174|
This class can render multiple texts over an image.
It can take a given image and renders one or more texts on the top of the image.
The text, coordinates, font, color of the texts and the size of the resulting image are configurable parameters.
The image with overlay texts may be returned in PNG or JPEG format as a string of a data URL.
This package requires the GD and EXIF extensions.
The alesinicio/imageOverlayer class allows the easy creation of multiple text overlays in images.
The usage is very simple. You will need:
- the class source (imageOverlayer.php);
- the image file which will be overlayed;
- a configuration file which tells how the overlaying will be done;
- the font files (TTF) you will use.
$configurationFile = "overlay_config.php";
$imgOutput = imageOverlayer::overlay($configurationFile); //CREATES AN IMAGE WITH THE OVERLAY.
$base64 = imageOverlayer::imgToBase64($imgOutput); //BASE64 ENCODING SO WE AVOID SAVING FILES TO DISK.
echo "<img src='$base64'>";
You can setup multiple overlays. Suppose you want to create both a "Happy Birthday" card and a "Happy Halloween" card. You will then get two images (the templates) and create two configuration files, which will tell the class where the overlays should be placed, and which data.
The data you will use is configurable. Maybe it will come from a database, maybe from a form, maybe it is hard-coded... it is your choice!
Your PHP must be compiled with FreeType support.
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.