On Magento 2.0.2 I edited my custom theme view.xml (app/design/frontend/XXXXX/default/etc/view.xml) and added 2 properties for each images type : transparency and background.
My file now looks like this
<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<media>
<images module="Magento_Catalog">
...
<image id="cart_cross_sell_products" type="thumbnail">
<width>250</width>
<height>165</height>
<transparency>false</transparency>
<background>[237,237,237]</background>
</image>
...
</images>
</media>
...
</view>
Looking at my file my background color should be set as this color (RGB 237,237,237 : hex #ededed). Actually that specific color is not applied but is black. Please take a look at the screenshot below:
What did I miss can someone lend a hand?
Edit : Still working on this issue. Some suggested to run bin/magento catalog:images:resize and bin/magento cache:flush but it did not help my cause.
Edit 2016-10-27 : I could not find a fix so I decided to extend the Image.php helper in a module and did something like this. It worked.
class Image extends \Magento\Catalog\Helper\Image{
protected function setImageProperties() {
parent::setImageProperties();
$this->_getModel()->setBackgroundColor([237,237,237]);
return $this;
}
}
Edit 2017-12-15 : Warning : This issue has been fixed long time ago by Magento. I strongly suggest you update your Magento 2 sale platform to the latest available version at the moment you read this, not only this will fix plenty of issues you have but it will also improve performance and security by a great length.