1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-02 10:23:29 +02:00
Imagick renders full transparent colors as black. But I want to render a
color like "rgba(255, 255, 255, 0)" as white in a image with no
transparency.
This commit is contained in:
Oliver Vogel
2024-01-06 14:16:56 +01:00
parent b198fe6a3a
commit 8b409f3870

View File

@@ -22,6 +22,10 @@ class JpegEncoder extends DriverSpecializedEncoder
->colorProcessor($image->colorspace())
->colorToNative($image->blendingColor());
// set alpha value to 1 because Imagick renders
// possible full transparent colors as black
$background->setColorValue(Imagick::COLOR_ALPHA, 1);
$imagick = $image->core()->native();
$imagick->setImageBackgroundColor($background);
$imagick->setBackgroundColor($background);