Custom background when resizing transparent PNG to JPG

Hi !

Right now, when resizing a transparent PNG file to JPG, the background turns black.

It would be awesome if we could add a background option directly to the thumbs presets like this:

'card' => ['width' => 450, 'quality' => 70, 'format' => 'jpg', 'background' => '#ebe7df'],

The same effect as this command line :

magick input.png -background "#ebe7df" -alpha background -alpha off output.jpg

Is there already a simple way to achieve this natively in Kirby 4, or is this a feature request?

Thanks!

I think you would need to extend the Darkroom driver to include further options such as background. I have never actually done this myself so can only point you at the documentation rather then an example. See here