PHP code example of o2system / image

1. Go to this page and download the library: Download o2system/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/ */

    

o2system / image example snippets


use O2System\Image;

// Manipulate Image
$manipulation = new Image\Manipulation();
$manipulation->setImageFile( 'path/to/images/kawah-putih.jpg' );
$manipulation->scaleImage( 15 );

// Watermark Image
$manipulation->watermarkImage( ( new Text() )
            ->setPosition( 'MIDDLE_BOTTOM' )
            ->setPadding( 10 )
            ->signature( 'Braunberrie Timeless Portraiture' )
            ->copyright( 'Copyright © ' . date( 'Y' ) . ' Poniman Mulijadi' . PHP_EOL . 'Braunberrie Timeless Portraiture' )
        );

// Send to browser
$manipulation->displayImage();

// Save Image
$manipulation->saveImage( 'path/to/save/images/kawah-putih.jpg' );