PHP Create Image

You can generate any Image with any text or image using PHP. Below Image is generated using given PHP code and Bruzu API

PHP Code to Generate Image


// Bruzu API key get yours at https://bruzu.com
$apiKey = "BRUZU-YOURKEY";
// Get random quote text
$quote= json_decode(file_get_contents("http://api.quotable.io/random"),true);

$params = array(            
    "backgroundImage"=>"https://source.unsplash.com/500x500/?wallpaper",
    "backgroundImage.opacity"=>0.8,
    "backgroundColor"=> "black", 
    "a.text"=>  $quote['content'],
    "a.color"=>"#ffffff",        
    "a.fontFamily"=>  "Poppins", 
    "a.shadow"=>  "1px 1px 1px black",
    "a.fontWeight"=> 800,        
    "apiKey"=>$apiKey       
);                  

$apiLink[]= "https://img.bruzu.com/?".http_build_query($params); 

$png = file_get_contents($apiLink."&ak=".$apiKey);
$imgLink = 'data:image/png;base64,' . base64_encode($png);
// You can use this link into your HTML code 
// <img src="<?=$imgLink?>" >

How to create an image using php? With few line of PHP Code and Bruzu API, you can generate any type of Image.
Can php generate images? PHP have few built-in functions or you can use Bruzu API to generate Images with PHP
How to add text to Image using PHP Using Bruzu API with PHP, you can use Image as background and text type elemet to write text over it.
Random image generator with PHP? Use the PHP code given above.