cancel
Showing results for 
Search instead for 
Did you mean: 

Resized product images background

Resized product images background

How the white background for resized product images (various thumbnails, for example) can be changed?

 

I have black background and horizontal aspect ratio and white stripes on all images looks not best...

4 REPLIES 4

Re: Resized product images background

Workaround: in

 
vendor/magento/framework/View/Design/Theme/Image.php
 
replace hardcoded color in
$image->backgroundColor([0, 0, 0]);
 
and in vendor/magento/module-catalog/Model/Product/Image.php
 
protected $_backgroundColor = [0, 0, 0];

Re: Resized product images background

I'm doing this after every upgrade... stupid.

Re: Resized product images background

Re: Resized product images background

Also, I found that only images "Color Type" with "RGB with Alpha" is resizing with a transparent background.

 

You can check whether your image colour type is "RGB with Alpha" by visiting http://fotoforensics.com and checking the metadata.

 

If it is not in "RGB with Alpha" color type you can convert the images using photoshop as below.

rgb_alpha_step1.png

Then export the file using File -> Export -> Export As 

Make sure you have below settings in the export screens.

rgb_alpha_step2.png