diff --git a/src/Drivers/Gd/Modifiers/DrawEllipseModifier.php b/src/Drivers/Gd/Modifiers/DrawEllipseModifier.php index 9f83e0dd6..801ed7641 100644 --- a/src/Drivers/Gd/Modifiers/DrawEllipseModifier.php +++ b/src/Drivers/Gd/Modifiers/DrawEllipseModifier.php @@ -15,6 +15,8 @@ public function apply(ImageInterface $image): ImageInterface { foreach ($image as $frame) { if ($this->drawable->hasBorder()) { + imagealphablending($frame->native(), true); + // slightly smaller ellipse to keep 1px bordered edges clean if ($this->drawable->hasBackgroundColor()) { imagefilledellipse( @@ -49,6 +51,7 @@ public function apply(ImageInterface $image): ImageInterface ) ); } else { + imagealphablending($frame->native(), true); imagefilledellipse( $frame->native(), $this->position()->x(), diff --git a/src/Drivers/Gd/Modifiers/DrawLineModifier.php b/src/Drivers/Gd/Modifiers/DrawLineModifier.php index 2d06131ad..fe49ca7b0 100644 --- a/src/Drivers/Gd/Modifiers/DrawLineModifier.php +++ b/src/Drivers/Gd/Modifiers/DrawLineModifier.php @@ -16,6 +16,7 @@ class DrawLineModifier extends AbstractDrawModifier public function apply(ImageInterface $image): ImageInterface { foreach ($image as $frame) { + imagealphablending($frame->native(), true); imageantialias($frame->native(), true); imageline( $frame->native(), diff --git a/src/Drivers/Gd/Modifiers/DrawPixelModifier.php b/src/Drivers/Gd/Modifiers/DrawPixelModifier.php index 5dbfec78c..fec4cbdce 100644 --- a/src/Drivers/Gd/Modifiers/DrawPixelModifier.php +++ b/src/Drivers/Gd/Modifiers/DrawPixelModifier.php @@ -19,6 +19,7 @@ public function apply(ImageInterface $image): ImageInterface ); foreach ($image as $frame) { + imagealphablending($frame->native(), true); imagesetpixel( $frame->native(), $this->position->x(), diff --git a/src/Drivers/Gd/Modifiers/DrawPolygonModifier.php b/src/Drivers/Gd/Modifiers/DrawPolygonModifier.php index 3e9d06915..835066112 100644 --- a/src/Drivers/Gd/Modifiers/DrawPolygonModifier.php +++ b/src/Drivers/Gd/Modifiers/DrawPolygonModifier.php @@ -19,6 +19,7 @@ public function apply(ImageInterface $image): ImageInterface { foreach ($image as $frame) { if ($this->drawable->hasBackgroundColor()) { + imagealphablending($frame->native(), true); imagefilledpolygon( $frame->native(), $this->drawable->toArray(), @@ -29,6 +30,7 @@ public function apply(ImageInterface $image): ImageInterface } if ($this->drawable->hasBorder()) { + imagealphablending($frame->native(), true); imagesetthickness($frame->native(), $this->drawable->borderSize()); imagepolygon( $frame->native(), diff --git a/src/Drivers/Gd/Modifiers/DrawRectangleModifier.php b/src/Drivers/Gd/Modifiers/DrawRectangleModifier.php index 393b9e8f8..0df6d1442 100644 --- a/src/Drivers/Gd/Modifiers/DrawRectangleModifier.php +++ b/src/Drivers/Gd/Modifiers/DrawRectangleModifier.php @@ -21,6 +21,7 @@ public function apply(ImageInterface $image): ImageInterface foreach ($image as $frame) { // draw background if ($this->drawable->hasBackgroundColor()) { + imagealphablending($frame->native(), true); imagefilledrectangle( $frame->native(), $this->position()->x(), @@ -35,6 +36,7 @@ public function apply(ImageInterface $image): ImageInterface // draw border if ($this->drawable->hasBorder()) { + imagealphablending($frame->native(), true); imagesetthickness($frame->native(), $this->drawable->borderSize()); imagerectangle( $frame->native(),