Re: [Image-SIG] ImageStat median calculation off?

2007-04-26 Thread Bill Janssen
Aghh, yes, thanks, just dopiness on my part. More coffee needed. Bill > Bill Janssen wrote: > > > > > I keep getting different values for "s.median" than I get for "h.index(v)". > > > > Shouldn't they be the same value? Am I missing something? > > Isn't it *mode* that you are calculating, n

Re: [Image-SIG] Font colour

2007-04-26 Thread Douglas Bagnall
[EMAIL PROTECTED] wrote: > 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? As Amos Newcombe pointed out, this is not what you really want. If you still want to try, something like this would be easiest: # co

Re: [Image-SIG] ImageStat median calculation off?

2007-04-26 Thread Douglas Bagnall
Bill Janssen wrote: > > I keep getting different values for "s.median" than I get for "h.index(v)". > > Shouldn't they be the same value? Am I missing something? Isn't it *mode* that you are calculating, not median? The median would be calculated by adding up the histogram values until you ha

Re: [Image-SIG] ImageStat median calculation off?

2007-04-26 Thread Bill Janssen
> I keep getting different values for "s.median" than I get for "h.index(v)". > > Shouldn't they be the same value? Am I missing something? I guess they theoretically could be different, but in the photo I'm looking at, there are no repeated values in the histogram, so that possibility doesn't o

[Image-SIG] ImageStat median calculation off?

2007-04-26 Thread Bill Janssen
I'm running the following program over a photo: #!/usr/bin/env python import sys, os, Image, ImageStat im = Image.open(sys.argv[1]) im = im.convert("L") h = im.histogram() for i in range(len(h)): print i, h[i] s = ImageStat.Stat(h) print s.mean, s.stddev, s.extrema, s.median v = max(h) l = l

Re: [Image-SIG] Font colour.

2007-04-26 Thread Paul Svensson
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. S

Re: [Image-SIG] Font colour.

2007-04-26 Thread Amos Newcombe
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 ot

Re: [Image-SIG] Font colour

2007-04-26 Thread export
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. > [EMAIL PROTECTED] wrote: > > > Is

Re: [Image-SIG] Font colour.

2007-04-26 Thread export
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. > > [EMAIL PROTECTED] wrote: > > > Is