Changing a white background to transparent (.png) |
|
Feb 20, 2011, 00:02
Post: #1
|
|||
|
|||
|
Changing a white background to transparent (.png)
I have a .png file of a WordPress logo that has a white background. I would like to take the white background and convert it to a transparent background. I am having a spot of trouble making it happen. Does anyone know of a good fool proof way to do it?
Thank you!
|
|||
|
Feb 20, 2011, 00:24
(This post was last modified: Feb 20, 2011 00:25 by ofnuts.)
Post: #2
|
|||
|
|||
|
RE: Changing a white background to transparent (.png)
The canonical way is to use Color/Color to alpha and give the background color, but that doesn't work too well with white because it makes a lot of things semi-transparent. To avoid this, you have to protect most of the logo with a selection that excludes it. So:
- use select by color tool, with treshold of 0, no feathering and no antialiasing. Click on the background. This will select only pure white pixels in the background - grow the selection by 2 pixels. The selection now includes the background, and the border pixels (anti-aliasing) - use Color/Color to alpha with white (it will only applies to background and logo border) Done. ![]() |
|||
|
Feb 20, 2011, 18:37
Post: #3
|
|||
|
|||
RE: Changing a white background to transparent (.png)
(Feb 20, 2011 00:24)ofnuts Wrote: - use select by color tool, with treshold of 0, no feathering and no antialiasing. Click on the background. This will select only pure white pixels in the backgroundI did a screen capture on sepoto's image and tried this and the result wasn't good at all. I backed up and used a threshold of 15, anitaliasing and feathering and followed the rest of your directions and it worked fine. |
|||
|
Feb 20, 2011, 19:54
Post: #4
|
|||
|
|||
RE: Changing a white background to transparent (.png)
(Feb 20, 2011 18:37)kaloua3 Wrote:Yes, I can reproduce your problem if I do a screen grab of the attachment thumbnail in the original post instead of using the real image... but if you look at it closely, its background is not uniform white, unlike the original image... (btw, using a threshold of 15 was too much, a threshold of 2 would have been enough)(Feb 20, 2011 00:24)ofnuts Wrote: - use select by color tool, with treshold of 0, no feathering and no antialiasing. Click on the background. This will select only pure white pixels in the backgroundI did a screen capture on sepoto's image and tried this and the result wasn't good at all. I backed up and used a threshold of 15, anitaliasing and feathering and followed the rest of your directions and it worked fine. My method assumes one is using the original file (of course the grey smear at the bottom of the original image has been removed)... in fact to check the results I went as far as: - extracting the foreground as described, and save as PNG - reload the image - add a white background - load the original image as another layer - put it in difference mode: if the anti-aliasing isn't taken properly in account, the border remains visible, here I couldn't see anything - confirm by using the histogram dialog to count the pixels: from memory, there were no pixels above a value of 2 ![]() |
|||
|
Mar 12, 2011, 03:49
Post: #5
|
|||
|
|||
|
RE: Changing a white background to transparent (.png)
It was on the process of attachment thumbnail, in which they could simply post the image. However, into the editing manner, yes they are right for that sequence. And then, making into the white background can able to make a good one.
Free consulting about best seo and seo professional |
|||
|
Mar 12, 2011, 15:00
Post: #6
|
|||
|
|||
|
RE: Changing a white background to transparent (.png)
Easiest way, Magic Wand, click white around edge of the Logo, then a bit of Manual Editing... to change the bits of white to transparent. Took me about 2 minutes to finish
![]() So, Add Alpha Chanel, Magic Wand, Set Threshhold to about 70 and then click the white you want to remove, ctlt+x, white is gone, if it kills more than you want, just hit ctl+v... Willy |
|||
|
Mar 12, 2011, 17:12
Post: #7
|
|||
|
|||
RE: Changing a white background to transparent (.png)
(Mar 12, 2011 15:00)Willy Wrote: Easiest way, Magic Wand, click white around edge of the Logo, then a bit of Manual Editing... to change the bits of white to transparent. Took me about 2 minutes to finishYuck Won't work properly in most cases... this is bound to produce a border that will be visible on some backgrounds. Your technique doesn't produce the semi-transparent pixels that are necessary for a smooth edge. So either you keep some background pixels, or you go too deep (and get a jagged edge).
![]() |
|||
|
Mar 12, 2011, 17:16
Post: #8
|
|||
|
|||
|
RE: Changing a white background to transparent (.png)
Or you just be very careful and do it well
, what I doRemove most of the background, then set your threshold down some, and go around and remove the bits of Whiter bits that are left over, and you get something that looks decent enough for me
|
|||
|
Mar 12, 2011, 17:33
Post: #9
|
|||
|
|||
RE: Changing a white background to transparent (.png)
(Mar 12, 2011 17:16)Willy Wrote: Or you just be very careful and do it wellYou cannot do it well with your method, unless you are willing to fix all pixels by hand. My results, that take around 20 seconds to produce: Show me yours
![]() |
|||
|
Mar 12, 2011, 17:54
Post: #10
|
|||
|
|||
|
RE: Changing a white background to transparent (.png)
I kept the white in mine that was part of the Logo, the only reason I said it should be done this way...
Took a bit longer, but it kept the white |
|||
|
Mar 12, 2011, 20:32
Post: #11
|
|||
|
|||
|
RE: Changing a white background to transparent (.png)
Wondering:
- why you worked on the thumbnail and not the original file. - why no transparent background - why the smear around the border Keeping the inner white is otherwise a snap: ![]() |
|||
|
Mar 12, 2011, 20:34
Post: #12
|
|||
|
|||
|
RE: Changing a white background to transparent (.png)
lols well I failed X D, I just used Thumbnail cause it was smaller and never though of bigger version, the black was so you could see that there wasn't as much white and the Blur was so that some of my mistakes would be covered up X D, I was kind of hurrying
|
|||
|
Mar 15, 2011, 19:19
Post: #13
|
|||
|
|||
|
RE: Changing a white background to transparent (.png)
I've got a fairly similar situation to the above, but I have a few elements from different files that I'm merging into my final image. I was able to get it to about the level of Willy's above (transparent outside the logo, interior white parts left opaque).
However, I'm trying to make the background *semi-transparent* and cannot seem to do that. Fully transparent is no problem, but making it 50% transparent does not work for me. Because I have multiple elements, I did this with (three) layers, with each layer having part of the logo (all non-logo parts being fully transparent), and the bottom (empty) layer being set to some level of opacity (say 50%). When I save it as .png I merge visible layers, etc. Everything looks fine within GIMP, but when I display the final graphic in Firefox (3.6) the background is completely transparent. If anyone has any thoughts as to what I've missed I would greatly appreciate it! By the by, I'm an almost complete beginner to GIMP. Thanks, - Dave |
|||
|
Mar 15, 2011, 19:38
Post: #14
|
|||
|
|||
RE: Changing a white background to transparent (.png)
(Mar 15, 2011 19:19)landbrake Wrote: If anyone has any thoughts as to what I've missed I would greatly appreciate it! I think I figured it out... I guess I need a color for the bottom layer (or white in my case) in order for it to have something to actually MAKE semi-transparent... when I filled the bottom layer with white and made it 50% transparent it worked just as I had hoped. Sorry for the VERY newbie question! - Dave |
|||
|
Mar 15, 2011, 20:17
Post: #15
|
|||
|
|||
|
RE: Changing a white background to transparent (.png)
There are no newbie questions... Sometimes simple questions will uncover some hidden complexity. You should never be ashamed to ask, especially when you consider yourself a noob. Later, when you have a reputation at stake, it's a bit different
![]() |
|||
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads... | |||||
| Thread: | Author | Replies: | Views: | Last Post | |
| Text with solid Background on image Help | jonesypeter | 1 | 33 |
Yesterday 20:20 Last Post: ofnuts |
|
| Making an Image Transparent. | chome4 | 5 | 165 |
Apr 26, 2012 20:47 Last Post: chome4 |
|
| Changing color in a texture | mrgou | 5 | 136 |
Apr 18, 2012 19:46 Last Post: ofnuts |
|
| After making the background transparent, can I... | chrisj | 1 | 71 |
Apr 18, 2012 00:04 Last Post: ofnuts |
|
| changing only specific colors | kevin32 | 10 | 158 |
Apr 10, 2012 12:48 Last Post: ofnuts |
|

Search
Member List
Help
GIMP Tutorials



![[Image: 2Tvo0.png]](http://i.imgur.com/2Tvo0.png)

Won't work properly in most cases... this is bound to produce a border that will be visible on some backgrounds. Your technique doesn't produce the semi-transparent pixels that are necessary for a smooth edge. So either you keep some background pixels, or you go too deep (and get a jagged edge).