PHP code example of cent4auka / rtimage

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

    

cent4auka / rtimage example snippets


$image = new \ResizeTool\Image($filePath);
$image->resize(100, 100);
$image->save();

// or
 
$image = new \ResizeTool\Image($originFilePath);
$image->resize(100, 100)
	->save($resultFilePath);


$image = new \ResizeTool\Image($filePath);

// methods of image:
$image->setBackgroudColor(0xFFFFFF)
$image->resize(100, 100);
$image->crop(400, 0, 300, 300)
$image->cropCenter(300, 300)

$image->save();