Re: Writing text on images



billjoe wrote:
I was wondering if I could do away with using the halo. I am afraid, it
would make the look of resulting image a bit "unreal". I was interested
in a method that could give me the most ideal color (if there can be
one) even if it comes at the cost of doing some processing on the
background image, if needed.

The only way that a single text colour could work would be if the area that the text occupied was mostly the same colour/brightness. Otherwise, you'll have to add an outline stroke, halo, drop shadow, or translucent box behind the text to homogenize the area around the text. This is what subtitle renderers for video players do.

If your background is homogeneous, you could just check the brightness of the background area that the text will cover. >128, use black text. <=128, use white text.

Cheers,
Nicholas Sherlock

--
http://www.sherlocksoftware.org
.