Welcome to WebmasterWorld Guest from 54.226.238.178

Forum Moderators: not2easy

Message Too Old, No Replies

Remove white background around an image on my website

     
10:38 pm on Dec 5, 2012 (gmt 0)

Junior Member

joined:Feb 23, 2012
posts: 91
votes: 0


On my website page, I've inserted an image in a php scripts and it has a white box around it. Image is saved in my "images" folder in my server.

I know how to remove the white back ground (Adobe Fireworks), so you just see the image.

What I want to know is now that I have my image with no background, how do I make it were the image does NOT show a white box on my webpage?

Thanks in advance,
Scotty

[edited by: limbo at 10:41 pm (utc) on Dec 5, 2012]
[edit reason] missing quotes [/edit]

11:28 pm on Dec 5, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13218
votes: 348


You have to find out where the white box is coming from. Off the top of my head:

--white parts of non-transparent image in non-white page, need to fix image itself (assuming either <= 256 colors, or alpha channel in browsers that support it)

--image margin non-zero on white-background page, needs CSS work
--image border non-zero with color white, ditto
--image padding non-zero if background-color of image div (or equivalent) is white, ditto

--(rare) if image is a link, browser supplies border and/or text-decoration unless told not to
2:01 am on Dec 6, 2012 (gmt 0)

Junior Member

joined:Feb 23, 2012
posts: 91
votes: 0


Sorry, I forgot to mention that I have a blue background.
2:07 am on Dec 6, 2012 (gmt 0)

Moderator from US 

WebmasterWorld Administrator martinibuster is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 13, 2002
posts:14221
votes: 226


>>>white parts of non-transparent image in non-white page, need to fix image itself

Right. Is it saved as a gif, png, or jpeg?
6:05 am on Dec 6, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13218
votes: 348


It better not be jpg, since last time I looked, the format didn't support transparency :)

Well, you can still fake it-- I've had to, when it's a choice between that and a full-color png with alpha channel*-- but you have to remember to change the image again if you ever change the page color.


* Dual problems: filesize and browser support.