Tuesday, November 11, 2008

Making a background transparent in Visual Studio 2005

Every developer gets to the point in a client-side project where you need to work with graphics.  My favorite tools are, in order of increasing power, the Visual Studio 2005 Image Editor, Microsoft Paint and Adobe Photoshop 3 (mega Kudos to Franklin Thompson, an amazing digital photographer and Web Guru, for giving me a Windows version of Adobe Creative Suite 3 - he's Mac only).

 

If I can get something done w/o having to switch windows or start up another app then I'm all for it.  In that vein, I wanted to make a minor modification to an icon.  I didn't have access to the original icon and had the darndest time getting the background to be transparent whenever I copied it into the Image Editor (32x32 256 colors image type).  Turns out you can have every pixel of a certain color considered transparent by:


  1. Making sure "Opaque Background" is unchecked (choose a selection tool then uncheck Image -> Draw Opaque).
  2. Switch to the eye dropper tool and right click a pixel that matches the color you want to become transparent.
  3. Switch to the selection tool then select the entire image.
  4. Paste the selection into a new image.  You can also paste it into the same image after deleting it then recreating it (with Draw Opaque unchecked).

 

No comments :

Post a Comment