{"id":9549,"date":"2013-04-29T01:33:28","date_gmt":"2013-04-29T05:33:28","guid":{"rendered":"http:\/\/info.template-help.com\/?p=9549"},"modified":"2016-02-22T08:10:45","modified_gmt":"2016-02-22T13:10:45","slug":"magento-removing-white-image-background","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/magento-removing-white-image-background.html","title":{"rendered":"Magento. Removing white image background"},"content":{"rendered":"<p><\/p>\r\n<p>This  tutorial is going to show you how to remove white border from Magento products images.<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=wiVDf_UZH78?width=1280&amp;height=720\" rel=\"prettyPhoto\">Magento. Removing white image background<\/a><\/p>\r\n<p>If you are  using\u00a0 different detentions for your product-list  images, you may face this problem:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2011\/07\/magento_white_image_background_removing_1.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2011\/07\/magento_white_image_background_removing_1-300x245.jpg\" alt=\"\" title=\"magento_white_image_background_removing_1\" width=\"300\" height=\"245\" class=\"alignnone size-medium wp-image-28935\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/07\/magento_white_image_background_removing_1-300x245.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/07\/magento_white_image_background_removing_1-150x122.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/07\/magento_white_image_background_removing_1.jpg 443w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<p>In order to  remove the white borders,<\/p>\r\n<ol>\r\n<li>On your FTP, using\u00a0 the File manager from your hosting\u00a0 Cpanel\u00a0  or\u00a0 an FTP client (FileZilla,  CuteFTP etc), go to the <strong>app\/design\/frontend\/your_theme\/template\/catalog\/product\/ <\/strong>folder folder (where your_theme \u00a0is the  unique name of your theme) . <\/li>\r\n<li>Open the <strong>list.phtml<\/strong> file to edit. <\/li>\r\n<li>Search  for the following code (about\u00a0 line 94): <\/li>\r\n<pre class=\"brush:php\">\r\n&lt;div class=&quot;grid-inner&quot;&gt; &lt;a href=&quot;&lt;?php echo $_product-&gt;getProductUrl() ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;stripTags($this-&gt;getImageLabel($_product, 'small_image'), null, true) ?&gt;&quot; class=&quot;product-image&quot;&gt;&lt;img class=&quot;pr-img&quot; src=&quot;&lt;?php echo $this-&gt;helper('catalog\/image')-&gt;init($_product, 'small_image')-&gt;resize(203); ?&gt;&quot; width=&quot;203&quot; height=&quot;203&quot; alt=&quot;&lt;?php echo $this-&gt;stripTags($this-&gt;getImageLabel($_product, 'small_image'), null, true) ?&gt;&quot; \/&gt;&lt;\/a&gt;\r\n<\/pre>\r\n<li>Change  the values of; resize(210), width=&quot;210&quot;, height=&quot;210&quot; to  the values of your image (the values themselves may differ depending on your  template number). Thus, if you image is 210&#215;164 it should look like below: <\/li>\r\n<pre class=\"brush:php\">\r\n&lt;div class=&quot;grid-inner&quot;&gt; &lt;a href=&quot;&lt;?php echo $_product-&gt;getProductUrl() ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;stripTags($this-&gt;getImageLabel($_product, 'small_image'), null, true) ?&gt;&quot; class=&quot;product-image&quot;&gt;&lt;img class=&quot;pr-img&quot; src=&quot;&lt;?php echo $this-&gt;helper('catalog\/image')-&gt;init($_product, 'small_image')-&gt;resize(210); ?&gt;&quot; width=&quot;164&quot; height=&quot;210&quot; alt=&quot;&lt;?php echo $this-&gt;stripTags($this-&gt;getImageLabel($_product, 'small_image'), null, true) ?&gt;&quot; \/&gt;&lt;\/a&gt;\r\n<\/pre>\r\n<li>Add  the following to the same code  <\/li>\r\n<pre class=\"brush:php\">\r\nconstrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->\r\n<\/pre>\r\n<p>so the final result looks like this: <\/p>\r\n<pre class=\"brush:php\">\r\n&lt;div class=&quot;grid-inner&quot;&gt; &lt;a href=&quot;&lt;?php echo $_product-&gt;getProductUrl() ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;stripTags($this-&gt;getImageLabel($_product, 'small_image'), null, true) ?&gt;&quot; class=&quot;product-image&quot;&gt;&lt;img class=&quot;pr-img&quot; src=&quot;&lt;?php echo $this-&gt;helper('catalog\/image')-&gt;init($_product, 'small_image')-&gt;constrainOnly(TRUE)-&gt;keepAspectRatio(TRUE)-&gt;keepFrame(FALSE)-&gt;resize(210); ?&gt;&quot; width=&quot;164&quot; height=&quot;210&quot; alt=&quot;&lt;?php echo $this-&gt;stripTags($this-&gt;getImageLabel($_product, 'small_image'), null, true) ?&gt;&quot; \/&gt;&lt;\/a&gt; \r\n<\/pre>\r\n<li>Save the changes to the file, log  into your Magento admin panel , the Catalog -&gt; Manage products\u00a0 menu and\u00a0  re-upload the image.<\/li>\r\n<li>Clear your Magento\/browser cache and  check the category page. The image should now have no white borders.<\/li>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2011\/07\/magento_white_image_background_removing_2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2011\/07\/magento_white_image_background_removing_2-300x245.jpg\" alt=\"\" title=\"magento_white_image_background_removing_2\" width=\"300\" height=\"245\" class=\"alignnone size-medium wp-image-28936\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/07\/magento_white_image_background_removing_2-300x245.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/07\/magento_white_image_background_removing_2-150x122.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/07\/magento_white_image_background_removing_2.jpg 457w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<\/ol>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=wiVDf_UZH78?width=1280&amp;height=720\" rel=\"prettyPhoto\">Magento. Removing white image background<\/a><\/p>\r\n<p><\/p>\r\n<p><\/p>\r\n<p><\/p>\r\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial is going to show you how to remove white border from Magento products images.<\/p>\n","protected":false},"author":2,"featured_media":28938,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[729],"tags":[1008,494,2407],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/9549"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=9549"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/9549\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/28938"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=9549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=9549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=9549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}