PHP code example of karster / mozify

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

    

karster / mozify example snippets


use karster\image\Mozify;

$mozify = new Mozify();
$result = $mozify->setImageSrc('path/to/image.jpg')
        ->setSearchWindow(10)
        ->setColorDepth(8)
        ->setTest(true)
        ->generate();

echo $result;

use karster\image\Mozify;

$mozify = new Mozify();
$result = $mozify->setImageSrc('path/to/image.jpg')
        ->setSearchWindow(10)
        ->setColorDepth(8)
        ->setWidth(500)
        //->setHeight(300)
        ->generate();

echo $result;