   BMP bleed color
  I have BMPs which use the color 255, 0, 255 to specify that the pixel should actually be fully transparent. Is there a way to do this in OpenGL when rendering the texture?I realize that before I load it I could search for the bleed color and set the alpha channel to transparent but for a variety of reasons that solution is not the best for my current problem.   
  You can do it in a pixel shader if you like. Really, though, doing the preprocessing on texture loading is the better solution. What are the "variety of reasons" that make you think it isn't best?   ;  I guess his reasons are that he may be editing the textures in real time using some other API that relies on colorkeying?   ;  That's fine. The time to process a color key into an alpha channel is trivial, so it would be fine to redo it every time the texture changed.   ;  @KevArnold: Perhaps you can give us more details as to your purposes so we can help better?The easiest way (though this is arguable) is to check the color of each pixel as you load the image as you stated, but it has the drawback of causing color bleeding problems.  The transparent color will tend to blend into the nearest opaque color along the edges where transparency meets opaqueness.  There are a number of solutions to this involving the way you generate your textures, different settings for alphafunc, or using a file format with an integrated alpha channel (combined with some other tricks).   ;  I am writing a UI that is defined in XML. One part of the XML defines all the resources that are used the other part defines the layout. In the layout a bleed color is specified. This means that multiple objects can use the same image but use different bleed colors.I should have said above that I am using OGL ES 1.1 so it is a fixed pipe line only.;Quote:Original post by KevArnoldI am writing a UI that is defined in XML. One part of the XML defines all the resources that are used the other part defines the layout. In the layout a bleed color is specified. This means that multiple objects can use the same image but use different bleed colors.I'm a little confused. Under what circumstances would you want to use the same image but a different color key?   ;  Just adding my experience with this which has been limited but hopefully worth while in this case. I also use the RGBA color 255,0,255,0 as my color key in many images and had some weird halos when using alpha blending, scaling and rotation. I found that prior to loading the texture (while the raw pixels were in memory) I could change the pixels which matched my color key to 0,0,0,0 which still left the halos but not nearly as noticeable since they were black. The original image on disk was never changed mainly because they are mostly 24 bit BMP files that I can easily edit with MS Paint or Paint .NET and black is a pretty popular color in most of my sprites and I don't want it all to be transparent.Hope it helps.   ;  one potential way to allow you to use different color keys for different images is as follows:  leave yourself a little border area of known proportion to the image at the beginning or somewhere, and set it to the color you want to use as your key.  Sample that color, and then compare against it for purposes of keying.   