PIL and font colours.

J

Johny

I use PIL to write some text to a picture.The text must be seen wery
clearly.
I write the text to different pictures but to the same position. As
pictures maybe different, colour, in the position where I write the
text, is also different.
Is there a way how to set the font colour so that it will be seen very
clearly in the picture?
For example, if the picture is bright ( for example yellow), the font
colour should be dark( e.g. black) and vice versa.
Can anyone help?
Thanks
L.
 
D

Diez B. Roggisch

Johny said:
I use PIL to write some text to a picture.The text must be seen wery
clearly.
I write the text to different pictures but to the same position. As
pictures maybe different, colour, in the position where I write the
text, is also different.
Is there a way how to set the font colour so that it will be seen very
clearly in the picture?
For example, if the picture is bright ( for example yellow), the font
colour should be dark( e.g. black) and vice versa.
Can anyone help?

Please don't post the same message three times. Once is enough.

For your problem are different solutions - you could compute an average
over the occupied background, convert the result to HSV and select a H
at the opposite, and also modify S and V.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top