+2  A: 

I can give you some steps on how to do this - and some tips that will help you with web development

  1. Download Firebug & install it.
  2. Right click on the image and select Inspect Element
  3. Look at the parent element of the img. Click on it and view the CSS in the right hand pane.
  4. Look for something like background-color: #000. Work out where it is being set. If it is not this element, repeat step 3, but look at the parent of what you were just looking at.
  5. Open the CSS file that Firebug is telling you the CSS is located (possibly boxes.css, but it's been a while since I've used Magento) and modify the CSS property. If you want white, chuck in the value #fff.
  6. Enjoy, and use Firebug to help you in other tricky spots!

Also, if Magento is a little crazy, it could be adding that background with GD, but I doubt it. If it is, you've got more work cut out for you!

alex
Sorry, I should have added a bit more to this. It's not a CSS issue. It's something to do with the Mage_Catalog_Model_Product_Image class, and how it crops a large image down for a thumbnail. But I've checked that and the color listed is white (RGB 255,255,255). I've also tried changing these values but it's always black.
Sam
That's a bit odd then. Sorry I can't help you further.
alex
A: 

I found an workaround for this. The side effect is that the class used for image resize will fill al images with white(even transparent ones), but this doesn't realy affect magento sice it doesn't use transparent fill anyway. So to solve the issue do this:

  1. Go to lib\Varien\Image\Adapter\Gd2.php in your magento folder
  2. Find this line "$this->_fillBackgroundColor($newImage);" and replace it with this line "$this->_fillBackgroundColor($newImage,$frameWidth,$frameWidth);"
  3. Find this line "private function _fillBackgroundColor(&$imageResourceTo)" and replace it with this "private function _fillBackgroundColor(&$imageResourceTo,$w,$h)"
  4. Find this code

    if (!imagefill($imageResourceTo, 0, 0, $color)) { throw new Exception("Failed to fill image background with color {$r} {$g} {$b}."); }

    and replace it with this "imagefilledrectangle($imageResourceTo,0,0,$w,$h,$color);"

That is it. The problem comes from the php function imagefill in Gd2 no working on some setings. This is an workaround using "imagefilledrectangle", and worked for me. Hope it solves your problem to.

Adi
Cool, I'll give that a shot. I got around it myself by using the images as backgrounds of a <span> that I put in place of the inserted images <img>
Sam