Skip to content
Kirby 3 CMS Thumb Component to optimize images using ImageOptim Api
Branch: master
Clone or download
bnomei apikey as callback
Signed-off-by: Bruno Meilick <>
Latest commit aa9cb37 Feb 6, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.php_cs.dist kirby3 rc-2 Dec 22, 2018
composer.json apikey as callback Feb 6, 2019
index.php pluginkit, apikey can be callback Feb 6, 2019 pluginkit, apikey can be callback Feb 6, 2019

Kirby 3 Thumb Imageoptim

GitHub release License Kirby Version Kirby 3 Pluginkit

Kirby 3 CMS Thumb Component to optimize images using ImageOptim Api.

Commerical Usage

This plugin is free but if you use it in a commercial project please consider to


  • unzip as folder site/plugins/kirby3-thumb-imageoptim or
  • git submodule add site/plugins/kirby3-thumb-imageoptim or
  • composer require bnomei/kirby3-thumb-imageoptim



In your site/config.php options set the ImageOptim API key.

'options' => [
    'bnomei.thumbimageoptim.apikey' => 'YOUR_API_KEY_HERE',
    // ... other options

Generate thumbs as usual using resize() File Method.

$img = $page->image('ukulele.jpg');
echo $img->resize(234)->html();

TIP: If you want your image to be optimized but retain their original size use: $img->resize() without providing a width or height.



  • default: null – your imageoptim apikey as string

TIP: you can also set a callback if you use the dotenv Plugin 'bnomei.thumbimageoptim.apikey' => function() { return env('IMAGEOPTIM_APIKEY'); },


  • default: true
  • set to false to disable optimization with this plugin


  • default: false
  • set to true when images are not public available (like a website with htpasswd).

DANGER: Content is always uploaded on localhost. allow_url_fopen PHP setting must be enabled for the API to do uploading. Check with ini_get('allow_url_fopen'). Please be aware of the potential security risks caused by allow_url_fopen!


This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.



It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.

You can’t perform that action at this time.