How to remove white background from product images in Magento 2.2.6? Please check this screenshort
2 Answers
In your view.xml set "width" and "height" as you wish and then "transparency" , "aspect_ratio" and "frame" to "false"
Example:
<?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="category_page_list" type="small_image">
<width>240</width>
<height>300</height>
<transparency>false</transparency>
<aspect_ratio>false</aspect_ratio>
<frame>false</frame>
</image>
</images>
</media>
</view>
-
not working please let me know step by step, because i put this code in this path"prntscr.com/lh8ax0" Commented Nov 12, 2018 at 6:52
-
There are "m2-theme" maybe your theme. So, into m2-theme find etc/view.xml file. Commented Nov 12, 2018 at 6:56
-
Pleasure to help you :) You can upvote as well :) Commented Nov 12, 2018 at 9:46
find category_page_grid In view.xml of your theme and add
<frame>false</frame>
node it will remove the white background / frame from images ( this will only remove from listing page )
your code will be li like this:
<image id="category_page_grid" type="small_image">
<frame>false</frame>
</image>