PHP code example of fundevogel / kirby3-colorist

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

    

fundevogel / kirby3-colorist example snippets


// config.php

return [
    // ..
    'thumbs.driver' => 'colorist',
];

// Converting a single image to single format:
$image = $page->image('example.jpg');
$webp = $image->toFormat('webp');
// Since this method return a `$file` object, chaining works as usual
$thumb = $webp->thumb('some-preset');

// Converting a single image to multiple formats:
$image = $page->image('example.jpg');
$results = $image->toFormats(['png', 'webp']);

// Converting multiple images to single format:
$images = $page->images();
$webps = $images->toFormat('webp');

// Converting multiple images to multiple formats:
$images = $page->images();
$results = $images->toFormats(['png', 'webp']);

$image = $page->image('example.jpg');
$profile = $image->identify();

// config.php

return [
    // ..
    'thumbs.quality' => [
        'avif' => 60,
        'webp' => 80,
    ],
];


// template.php
$image->toFormat('avif')->thumb(['width' => 300]);

// config.php

return [
    // ..
    'fundevogel.colorist.template' => [
        'avif' => 'early-bird',
        'webp' => 'google-lover',
    ],
];