Remove image solid background with c sharp
I'm trying to find some info about removing an image background "automagicall开发者_StackOverflow社区y" if possible in .NET.
Actually I could not find much data and I don't event know if it's possible or are there any API components available.
Any ideas?
Establish a rule, for example that the pixel at [0,0] must be the 'transparent' color (the background). Load the image as a Bitmap (let's call it bmp), and then do something like this:
bmp.MakeTransparent(bmp.GetPixel(0, 0));
Homer, for the file formats you suggest, there is no easy way of defining what the 'background' is. For instance, say you have some colorful text on a white background. I'm assuming you'd want to make the white transparent? There is nothing in the file format to say "this layer or color is the background". There may be heuristics for trying to determine the background color, but there will probably be no library to do something like image.MakeBGTransparent().
精彩评论