PHP Classes

Custom Headlines: Render text headlines on the top of images

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (13)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 225 All time: 8,179 This week: 10Up
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: 50
All time rank: 135116 in Argentina Argentina
Week rank: 346 Up3 in Argentina Argentina Up
Innovation award
Innovation award
Nominee: 9x

Details

CustomHeadlines

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

Usage

// 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
$ch->getFontFile();
$ch->setFontSize(22);

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

// Create image
$ch->Create($image,$headline,$areaX,$areaY,$areaW,$areaH,$alpha,$imageResult);

// Get the image
$imgaeResult = $ch->getImage();
Screenshots  
  • example2_result1.jpg
  • example_result1.jpg
  • example_result2.jpg
  • example_result3.jpg
  Files folder image Files  
File Role Description
Files folder imageimages (8 files)
Accessible without login Plain text file composer.json Data composer
Plain text file CustomHeadlines.php Class class
Accessible without login Plain text file example.php Example example
Accessible without login Plain text file LICENSE Data license
Accessible without login Plain text file README.md Doc. Readme

  Files folder image Files  /  images  
File Role Description
  Accessible without login Image file example.jpg Icon image example
  Accessible without login Image file example2.jpg Icon image example
  Accessible without login Image file example2_result1.jpg Icon image example
  Accessible without login Image file example2_result2.jpg Icon image example
  Accessible without login Image file example2_result3.jpg Icon image example
  Accessible without login Image file example_result1.jpg Icon image example
  Accessible without login Image file example_result2.jpg Icon image example
  Accessible without login Image file example_result3.jpg Icon image example

 Version Control Unique User Downloads Download Rankings  
 76%
Total:225
This week:0
All time:8,179
This week:10Up