Custom Headlines: Render text headlines on the top of images

Recommend this page to a friend!
  Info   Example   Screenshots   View files (13)   Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 222 All time: 8,078 This week: 356
Version License PHP version Categories
custom-headlines 1.0GNU General Publi...3.0PHP 5, Graphics, Text processing
Description Author

This class can render text headlines on the top of images.

It can take a given image and renders a text inside a given rectangle of the image.

The resulting image is saved to another given file.

The font, text color, transparency level are some of the configurable parameters.

Picture of Luciano Salvino
  Performance   Level  
Name: Luciano Salvino <contact>
Classes: 11 packages by
Country: Argentina Argentina
Age: 47
All time rank: 143317 in Argentina Argentina
Week rank: 259 3 in Argentina Argentina
Innovation award
Innovation award
Nominee: 9x



CustomHeadlines is a PHP class that add headlines to images with text and background color depending on the image color index of selected area


// Define parameters

// Image Source

$image = 'images/example.jpg';
// Image result
$imageResult = 'images/example_result1.jpg';
// alpha of the box area
$alpha = 40;
// text of headline
$headline = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua';
// Fontsize
$fontSize = 18;
// Box area position and measures
$areaX = 10;
$areaY = 10;
$areaW = 560;
$areaH = 90;

// Initialize Class
$ch = new CustomHeadlines();

// set font size and family

// You can set the inverse color to set text with de inverse color respect of background (optionl)
$ch->colorInverse = true; // Default: false

// Create image

// Get the image
$imgaeResult = $ch->getImage();
  • example_result3.jpg
  • example_result2.jpg
  • example_result1.jpg
  • example2_result1.jpg
File Role Description
images (8 files)
composer.json Data composer
CustomHeadlines.php Class class
example.php Example example
LICENSE Data license Doc. Readme

  Files  /  images  
File Role Description
   example.jpg Icon image example
   example2.jpg Icon image example
   example2_result1.jpg Icon image example
   example2_result2.jpg Icon image example
   example2_result3.jpg Icon image example
   example_result1.jpg Icon image example
   example_result2.jpg Icon image example
   example_result3.jpg Icon image example

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:8,078
This week:356

For more information send a message to info at phpclasses dot org.