PHP code example of artemeon / image

1. Go to this page and download the library: Download artemeon/image library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

artemeon / image example snippets


$image = new Image();
$image->load("/files/images/samples/PA252134.JPG");
 
// Scale and crop the image so it is exactly 800  600 pixels large.
$image->addOperation(new ImageScaleAndCrop(800, 600));

// Render a text with 80% opacity.
$image->addOperation(new ImageText("Kajona", 300, 300, 40, "rgb(0,0,0,0.8)")
 
// Apply the operations and send the image to the browser.
if (!$image->sendToBrowser()) {
    echo "Error processing image.";
}