Description
This class makes it super easy to render images with multiple, independently styled text blocks. You can control each text block's alignment, color, font, line height, and size. You may also position each text block with specific X and Y coordinates relative to the source image.
Image With Text alternatives and similar libraries
Based on the "Imagery" category.
Alternatively, view Image With Text alternatives based on common mentions on social networks and blogs.
-
Glide
Wonderfully easy on-demand image manipulation library with an HTTP based API. -
PHP Image Workshop
ImageWorkshop is a PHP5.3+ library that helps you to manage images based on GD library -
Image Optimizer
Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools. -
GIF Creator
GifCreator is a PHP class that creates animated GIF from multiple images -
GIF Frame Extractor
GifFrameExtractor is a PHP class that separates all the frames (and their duration) of an animated GIF -
FasterImage
:racehorse: find the size of an image without downloading the whole file. Supports batch requests.
Access the most powerful time series database as a service
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Image With Text or a related project?
README
Image with Text
This class makes it super easy to render images with multiple, independently styled text blocks. You can control each text block's alignment, color, font, line height, and size. You may also position each text block with specific X and Y coordinates relative to the source image.
Installation
Install this library with Composer. Add this to your composer.json
file:
{
"require": {
"nmcteam/image-with-text": "~2.0"
}
}
Then run composer install
.
Usage
Here's a quick demonstration. You can find this full working demo in the example/
directory.
<?php
require '../vendor/autoload.php';
// Create image
$image = new \NMC\ImageWithText\Image(dirname(__FILE__) . '/source.jpg');
// Add styled text to image
$text1 = new \NMC\ImageWithText\Text('Thanks for using our image text PHP library!', 3, 25);
$text1->align = 'left';
$text1->color = 'FFFFFF';
$text1->font = dirname(__FILE__) . '/Ubuntu-Medium.ttf';
$text1->lineHeight = 36;
$text1->size = 24;
$text1->startX = 40;
$text1->startY = 40;
$image->addText($text1);
// Add another styled text to image
$text2 = new \NMC\ImageWithText\Text('No, really, thanks!', 1, 30);
$text2->align = 'left';
$text2->color = '000000';
$text2->font = dirname(__FILE__) . '/Ubuntu-Medium.ttf';
$text2->lineHeight = 20;
$text2->size = 14;
$text2->startX = 40;
$text2->startY = 140;
$image->addText($text2);
// Render image
$image->render(dirname(__FILE__) . '/destination.jpg');
How to Contribute
- Fork the repo on GitHub and send a pull request
- Find a list of TODOs on the GitHub issue tracker
We have not written any unit tests just yet, but we hope to do that soon.
Author
Copyright
(c) 2013 New Media Campaigns
License
MIT
*Note that all licence references and agreements mentioned in the Image With Text README section above
are relevant to that project's source code only.