Black and white background with GD library

A

Anonymous

Guest
I have a jpg image with a background that is - depending on the conditions - black or white. As far as I understand from the internet this comes because the image was derived from another format (like png) where this "color" was transparent.

Now I have at the moment an image processing routine that supports both gd and Imagick. When I process certain images with Imagick I get a white background. However, when I do the same with gd I get a black background. I would like to have a white background with gd too. What could this be?

See for example this image: http://bilbil.com/img/p/9/1/5/6/9156.jpg

In my browser it gives a black background.But processed with Imagick this turns white:

http://www.bilbil.com/9156-thickbox_default/snoepbusje-jarige.jpg
 
Yes you can change the background colour, but it's not called background since you draw parts of an image to a position on the drawing area, as such background does not exist - it sounds complicated but isn't, e.g. you draw lines, cirlces etc.. after setting their outline and fill colours.
 
On another note, if your background is transparent, you can change the background by using css, i.e. by changing the background colour of the page that the image is on.
 
Back
Top