[Image-SIG] Font colour.

Paul Svensson paul-python at svensson.org
Thu Apr 26 14:48:50 CEST 2007

On Thu, 26 Apr 2007, Amos Newcombe wrote:

> You find the complementary color by subtracting each color band from 255
> (assuming 8-bit color). The problem with this is that if your original color
> is medium gray, the complementary color will be very close to it and you
> will get no legibility. So you have to test for this case and go to some
> other color, perhaps black or white.

Slightly better than complementing each color band, set it as far off
from the background as you can; [00..7F] -> FF, [80..FF] -> 00.


> Amos
> On 4/26/07, export at hope.cz <export at hope.cz> wrote:
>> Christopher ,
>> Thank you for your reply.
>> Is there a way how to find out a complementary colour for an area where I
>> will write the text, so
>> that the text will be seen clearly?Is there a routine in PIL or in Python
>> somewhere?
>> Thank you for help
>> Lad.


More information about the Image-SIG mailing list