The World’s Leading Microsoft .NET Magazine
   
 
timstall

Donate Today!

Search Box

 

Calendar

««Sep 2010»»
SMTWTFS
    1234
567891011
12131415161718
19202122232425
2627282930

My RSS Feeds








Mailing List

Most Popular Tags

                                                           

Making a transparent Gif with the free Paint.Net

posted Monday, 21 May 2007

Sometimes a developer will need to make a transparent GIF, such as for a web page. This should be trivial - you essentially want to say "make every pixel that is color X be transparent", but most standard development tools (VS, Paint, etc...) don't let you do this. While there are lots of expensive graphics programs out there, most developers don't have these.

An easy way to make a transparent gif is using the free Paint.Net (written entirely in .Net).

  1. Download Paint.Net. It's a pretty good, free, graphics editing tool.
  2. Open up your image. Save it as a gif.
  3. In the Tool section, use the "Magic Wand" feature.
  4. Set it's tolerance to '0%'
  5. Drag it over the section you want to make transparent. The magic wand catches an entire region of adjacent, same-color-range, pixels
  6. Once the region is selected, then hit the delete key. [Updated 12/11/2007]

I find this convenient for simple web imaging needs. Also, Paint.Net has a ton of other features, like gradients, blends, and special effects.

 


Living in Chicago and interested in working for a great company? Check out the careers at Paylocity.

tags:    

links: digg this    technorati    




1. picasso left...
Tuesday, 11 December 2007 12:43 am

Isn't there a step 6? I've got all the pixels selected, but then what?


2. Tim Stall left...
Tuesday, 11 December 2007 8:47 am

Oops, yes. Step 6: Once the region is selected, then hit the delete key.


3. Sultan left...
Wednesday, 16 January 2008 2:11 pm

Thanks! I have to make temporary icons and toolbar buttons (which are subsequently replaced by our marketing team with professional ones) and I hate using Windows Paint precisely because I can't make the "background" transparent. I'll never be without Paint.NET from now on :)


4. King left...
Friday, 19 September 2008 2:48 am

When saving as a GIF, it asks for the Transparency threshold saying pixels with an alpha value less than threshold will be fully transparent. How do we know the alpha of each pixel/color?

Thanks.


5. Tim Stall left...
Friday, 19 September 2008 1:34 pm

King - you can just do trial and error. For example, if you have a red circle, where everything that should become transparent is black, the colors are different enough that clicking the black region will select the entire section, and then you can delete it. However, if the image is a blur of similar colors - say everything is a similar shade of green, then it will be much harder to select the region to delete. Best bet is to color your region-to-delete in an obviously contrasting color, then you can easily delete it.


6. CIO left...
Friday, 6 March 2009 10:54 am

Perfect information, got what I needed (my signature as a transparent gif) in less than 10 minutes start to finish. Good info.


7. Mike left...
Sunday, 22 March 2009 2:40 pm

Worked Great - in 5 minutes done. Thanks


8. Asad Hamdani left...
Sunday, 5 April 2009 9:29 am :: http://allbestsellers.blogspot.com

Thanks. I'm a big fan of Paint.Net and use it quite frequently instead of the costly big guys like, Adobe etc.

Your tip worked well.


9. JQH left...
Monday, 27 April 2009 4:44 pm

100% gangster! thanks!


10. Tom Lewellen left...
Tuesday, 28 April 2009 4:43 pm

I follow the instructions, choosing the white background that I want transparent but only a few pixel are changed, leaving the remaining white, white. Not sure why it is not catching all the white pixels in the region.


11. Rowyn left...
Tuesday, 19 May 2009 11:03 am :: http://rowyn.livejournal.com/

THAT WAS SO AWESOME!

Thanks for the pointer to Paint.NET, that was a zillion times easier than the last time I tried to make a gif with a transparent background. =)


12. Andrei left...
Wednesday, 21 April 2010 3:59 am

Brilliant, many thanks. At the end when saving it, need to click 'Defaults' for the transparency threshold. I had to anyway.

Many thanks again.


13. Sergey left...
Friday, 2 July 2010 8:36 am

Cool, thanks! Works like a charm. Before reading this, I've tried to set the transparency of a color, and then flood-fill it, but it didn't work. Your method, however, works flawlessly.

Hope that this page would continue to show up high in search results.

Thanks again!


14. Pat Long left...
Tuesday, 6 July 2010 4:52 am

Thanks a lot. So god damn simple, I was looking around Paint .NET for the make transparent tool :-)


15. WD left...
Friday, 30 July 2010 8:41 pm

Oh my gosh, I've been looking all over Google for how to do this! The article is so simple! I tried it out in Paint.NET AND IT WORKED! Thank you so much!