system/Images/Handlers/ImageMagickHandler.php
public function _flatten(int $red = 255, int $green = 255, int $blue = 255)
	{
		$flatten = "-background RGB({$red},{$green},{$blue}) -flatten";

		$source      = ! empty($this->resource) ? $this->resource : $this->image->getPathname();
		$destination = $this->getResourcePath();

		$action = ' ' . $flatten . ' "' . $source . '" "' . $destination . '"';

		$this->process($action);

		return $this;
	}
public function _flatten(int $red = 255, int $green = 255, int $blue = 255)
	{
		$flatten = "-background RGB({$red},{$green},{$blue}) -flatten";

		$source      = ! empty($this->resource) ? $this->resource : $this->image->getPathname();
		$destination = $this->getResourcePath();

		$action = ' ' . $flatten . ' "' . $source . '" "' . $destination . '"';

		$this->process($action);

		return $this;
	}
Flattens transparencies, default white background

@param integer $red
@param integer $green
@param integer $blue

@return $this
@throws \Exception