Images
Images can be resized and cropped with the $image->thumb() method, and the appropriate value for the <img srcset> attribute can be produced with the $image->srcset() method to enable HTML responsive images. Various patterns are explored in Cookbook: responsive images.
Presets can be defined in the config under the thumbs property. They can be referenced by name in the $image->thumb() and $image->srcset() methods. The $image->resize() method is a wrapper over $image->thumb() for ad-hoc resizing, but it’s probably best to keep all size definitions in the config file.
Kirby lets users set the focus point of an image from the Panel.
To change the HTML markup for images in the image and gallery blocks, modify their block snippet.
Image drivers
Kirby supports Graphics Draw (GD) and ImageMagick for resizing images. Kirby uses these through the SimpleImage PHP library. Depending on the versions for each of the moving pieces the failure mode for the various image formats can vary, from straightforward crashes to returning the original (huge) image instead of a scaled down AVIF.
It’s important to inspect in production the outputs for the image formats you’re targeting.
TODO: add simple image thumbing test (WEBP, AVIF, etc.) in TocmaiKit