Skip to content

Poster and image generator for news/aticles/other.

License

Notifications You must be signed in to change notification settings

ange007/PosterGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PosterGen - News and Articles poster generator

Use for:

  • Poster for your site or blog
  • Poster for social network
  • Poster for your promo materials ☻

Example Images

PosterGen

PosterGen

PosterGen

PosterGen

PosterGen

PosterGen

PosterGen

Dependencies

  • PHP >= 5.6
  • GD

Install

composer require ange007/poster-gen

Example Code

<?php
	use \PosterGen;
	
	// Generate poster
	$poster = ( new \PosterGen\PosterGen( [ ] ) )
		->setSize( 1280, 720 )
		->setBackgroundImage( __DIR__ . "/backgrounds/1.jpg" )
		->setHorizontalAlignment( 'center' )
		->setVerticalAlignment( 'center' )
		->setFontShadow( '#333333', -2, 2 )
		->setOverlayColor( '#FF0000' )
		->setBorder( 'black', 1 )
		// Title
		->setFont( __DIR__ . "/fonts/Roboto-Regular" )
		->setFontSize( 40 )
		->setFontColor( '#FFFFFF' )
		->addText( 'Microsoft buying GitHub' )
		->addText( '' )
		// Subtitle
		->setFont( __DIR__ . "/fonts/Blogger_Sans.otf" )
		->setFontSize( 20 )
		->setFontColor( '#00FFFF' )
		->addText( 'The deal is concluded' )
		// Watermark
		->setTextBackground( 'black', 50 )
		->setHorizontalAlignment( 'right' )
		->setVerticalAlignment( 'bottom' )
		->setFontSize( 14 )
		->setFontColor( '#FFFFFF' )
		->setFontShadow( '' )
		->setFontStroke( 'black' )
		->addText( 'http://news.com' );
		  
	// Poster output
	echo $poster->saveToBase64Image( );

Plans

  • Background position and adaptation
  • Text rotate
  • Image rotate

License

It is released under the MIT License.