planned overhaul of colour spaces

42 views
Skip to first unread message

Jon Peirce

unread,
Mar 17, 2010, 9:55:40 AM3/17/10
to psychop...@googlegroups.com
Hi all,

I'm planning a bit of an overhaul of the way PsychoPy handles colour input values, detailed below. There are several reasons:
 * I want to allow a greater variety of ways to specify stimulus colours to suit different needs, e.g. with names, hex values, (CIE coords?)
 * I want to improve the precision of the existing colour spaces
The intention is that this will not break existing scripts, although at some point the deprecated methods will be removed (initially they will spit a warning).

Opinions very welcome,
Jon


The planned changes are:

1. deprecate args/methods like setRGB, setDKL, setLMS and add setColor, and setColorSpace. Allows more color spaces to be added without proliferation of methods and arguments

2. Add further color space options. End up with;
  * rgb (almost as current but see point 3.)
  * rgb255 (for users not liking the -1:1 range)
  * lms (almost as current but see point 3.)
  * dkl (almost as current but see point 3.)
  * hex (specify a color with a hexadecimal value, as on web)
  * name (allow the standard web color names to be used as text, e.g. 'white', 'blue', 'CornflowerBlue', ...)

3. rgb, dkl and lms color spaces should not use very top value (255) to keep symmetry around mid-grey point. This space is mostly to be used by people wanting mathematical control of their colors around a centre-point. As with most programs PsychoPy currently rounds to nearest values and ends up with black=0, mid grey=128, white=255.
For rgb255, hex, name, it seems more likely that the user wants a particular colour value, irrespective of its relation to mid-grey, so for these the full 0-255 should be used (will have the slightly odd effect that white is not quite identical in rgb255 and rgb).

4. add a further, more precise, gamma correction option for monitors (but leave existing calibrations unchanged). User should be able to choose for their monitor between gamma equations. This could be implemented in the monitor centre as a dropdown control of different equations:
  * y=a+x**gamma #current default
  * y=(a+x)**gamma
  * y=b+(a+x)**gamma #suggested new default


This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

Reply all
Reply to author
Forward
0 new messages