When running a media conversion against an SVG file to another file format that support transparency such as PNG or WEBP, conversions will lose any transparency and force a white background.
Two modifications were needed to make it work:
Convert SVG files to PNG32 instead of JPEG to avoid loosing transparency
Set the image background color before reading the image
I tested this change on PHP 8.3 / Imagick 1809 / ImageMagick 7.1.1-41 on Fedora Linux.
The PNG format of png32 was the one previously used before this commit, I guess 32 is good enough for most SVG use-cases.
Hello,
When running a media conversion against an SVG file to another file format that support transparency such as PNG or WEBP, conversions will lose any transparency and force a white background.
Two modifications were needed to make it work:
I tested this change on PHP 8.3 / Imagick 1809 / ImageMagick 7.1.1-41 on Fedora Linux.
The PNG format of
png32
was the one previously used before this commit, I guess 32 is good enough for most SVG use-cases.