[IPython-dev] default colorscheme

David Hirschfeld dave.hirschfeld at gmail.com
Wed Jul 6 04:59:25 EDT 2011


On Wed, Jul 6, 2011 at 8:43 AM, Fernando Perez <fperez.net at gmail.com> wrote:
> On Wed, Jul 6, 2011 at 12:30 AM, Min RK <benjaminrk at gmail.com> wrote:
>> That should cover just about everything people will actually use, but just for fun is green 255 dark, as that formula would suggest?
>>
>> By that formula, rgb(60,255,60) is also dark, which is pretty far from true. It's also pretty hideous, so not a specific edge case we should worry about.
>>
>> (I'm not suggesting that we use a more precise formula, just noting that the average doesn't always get the right answer).
>
> That's why I said 'quick and dirty' :)  It's the crudest possible
> cutoff, bisecting the luminosity range, and it doesn't take into
> account any of the (valid) visual complexities you allude to.  But it
> will separate between very light and really dark reasonably well,
> messing up other wonky cases.
>
> Cheers,
>
> f

Not sure if this helps at all but over on the numpy list Chris Barker suggested
the ITU-R 601-2 luma transform:

Christopher Barker <Chris.Barker <at> noaa.gov> writes:
>
> you also might want to get a bit fancier than simply scaling linearly
> R,G, and B don't necessarily all contribute equally to our sense of
> "whiteness"
>
> For instance, PIL uses:
>
> """
> When from a colour image to black and white, the library uses the ITU-R
> 601-2 luma transform:
>
>      L = R * 299/1000 + G * 587/1000 + B * 114/1000
> """
>
> which would be easy enough to do with numpy.
>
> -Chris
>



More information about the IPython-dev mailing list