Question

I'm using Visual Studio icon library (VS2008ImageLibrary), there are some BMP files with a pink background. How can I make the pink background become transparent? What software can I use to do this? Any free one?

Thanks

Was it helpful?

Solution

You can try it online provided you can transform your bmp into a gif first.

Or you can grab PAINT.Net (freeware), and apply a transparent background by following this video instructions.

OTHER TIPS

I used IrfanView's batch conversion tool. It's still some work, because you have to click the pink area on every single icon instead of just specifying pink as transparent color, but it worked. It would be easy to write a simple conversion tool using GDI+ though, which I considered as well.

Note that even though you can use them then as transparent images, many of them unfortunately still have ugly edges when you render them on a dark background or use them as overlay. If you just want very few of them, consider tweaking them individually if you think you'll not always have a bright background.

You can do it by using ImageMagick convert:

convert input.png -transparent magenta  output.png

By the way, it is not pink, its magenta colour.

While I don't know the modern .NET answer to your question, it's worth noting the historical reason for these bitmaps with magenta backgrounds:

Back in the Win32-only days, there were some Common Controls (like the Toolbar, and ListView) that took these bitmaps and a colour to be treated as transparent, and then rendered that colour as transparent. I imagine that, behind the scenes, they used functions like TransparentBtl.

I know it's something related to Form.TransparencyKey but I donno what is exactly that pink, you have to know the exact RGB / system or Web color.

if you know please share us

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top