PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Drawing anti-aliased text on non-uniform background

Does anyone know an effective way to draw anti-aliased bitmap text on a non-uniform background?

For example, if I create a bitmap with anti-aliased text in Photoshop with the colormask as the background color, the edge of each character is blended with the background (anti-aliased). So, when I draw the text to the screen (with the colormask set as the background), you can still see a slight coloring of the background color on the text edges.

It seems that text must have sharp edges (not anti-aliased), in order to do color masking. I know that you can fake it by including the final background as part of the text bitmap, but this limits where the text can be used.

I hope I've explained this clearly...maybe not, I'm starting to confuse myself. 8O

Thanks...
:D
Treat each pixel intensity as an alpha value. i.e. a fully black pixel (0) is totally opaque and a 50% gray pixel (128) would be 50% transparent.

Then blend all the pixels from the character into the background image.

More expensive then a straight blit, but it will do what you want.
Ah-ha! I didn't think about that. That would do the trick!

Thanks Thierry...
:D