diff --git a/lib/internal/Magento/Framework/Image/Adapter/Gd2.php b/lib/internal/Magento/Framework/Image/Adapter/Gd2.php index 15505d3fd6439..cce84467e665c 100644 --- a/lib/internal/Magento/Framework/Image/Adapter/Gd2.php +++ b/lib/internal/Magento/Framework/Image/Adapter/Gd2.php @@ -346,6 +346,10 @@ public function resize($frameWidth = null, $frameHeight = null) $newImage = imagecreate($dims['frame']['width'], $dims['frame']['height']); } + if ($isAlpha) { + $this->_saveAlpha($newImage); + } + // fill new image with required color $this->_fillBackgroundColor($newImage); diff --git a/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php b/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php index ffdde07768022..48a6b3699a945 100644 --- a/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php +++ b/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php @@ -168,6 +168,13 @@ public function resize($frameWidth = null, $frameHeight = null) ); } + $newImage->compositeImage( + $this->_imageHandler, + \Imagick::COMPOSITE_COPYOPACITY, + $dims['dst']['x'], + $dims['dst']['y'] + ); + $newImage->compositeImage( $this->_imageHandler, \Imagick::COMPOSITE_OVER,