2011/2/21 <J.B.C.Engelen@...1887...>:
Hi all, I just committed a new display mode: grayscale. It is separate from the other display modes. The grayscale mode is a "Color display mode", see the menu. When activated, it shows all colors in grayscale on-canvas. This does not (yet?) influence exporting, or saving. It only concerns the on-canvas view of the file, like outline display mode.
Display modes should not affect exporting or saving, by design. Grayscale exporting should be handled using a preference in the export dialog.
Right now, there is no preference to change the grayscale calculation. At the moment it uses: grayscale value = 0.33 * red + 0.59 * green + 0.11 * blue. I found this somewhere on internet, but forgot where, and it might be wrong/unusual. I intended to add a preference setting for these values, but have not done so. Let me know if that is desired.
The calculation should match the luminosity formula found in SVG filters and masks definition, which is: 0.2125 * R + 0.7154 * G + 0.0721 * B Additionally, the calculation should be performed in linear RGB, which means you need to convert between sRGB and that. The conversion formulas can be found e.g. here in the section "useful data": http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/
The feature will probably need some tweaks or a partial rewrite in order to work with the Cairo branch.
Regards, Krzysztof