Permalinks for resized images

You could create your own mini thumb server, here is a very basic example

use Kirby\Http\Response;

return [
'routes' => [
	[
		'pattern' => 'thumbserver/(:any)',
		'action'  => function ($fileUuid) {

			$file = site()->index()->files()->findBy('uuid', 'file://' . $fileUuid);

			if ($file) {
				$width  = get('width') ?? 200;
				$height = get('height') ?? 200;
				$format = get('format') ?? 'jpg';
				$crop   = get('crop') ?? false;

				return Response::file($file->thumb([
							'width'  => $width,
							'height' => $height,
							'crop'   => $crop,
							'format' => $format,
						]
					)->url());
			}

			return null;
		},
	],
],
];

Then in your template, just echo the url:

<img src="<?= url('thumbserver/d2mcgqZ8fKNNyN8E?width=400&height=400&crop=center&format=webp') ?>" alt="">

Instead of using the path to page and filename, you could also work with the file UUID.

This approach might even work well for headless setups, I guess.

Note that anyone with a file uuid can create any sizes of thumbs using this route, so this is a bit of a security issue. Or you would have to limit the possible sizes to those you use anyway, but in any case this needs some restrictions that prevent malicious people from doing evil things.

For images in newsletters it might be better to upload them to your newsletter service and serve from there, or move the relevant files manually to the assets folder (and serve from there), or load images via CDN, or as I mentioned above change the token and lose the cache invalidation…