Archived issue #0031454
Visualization - perceptually uniform color scale
Description
Current implementation of AIS_ColorSCale can generate color scale using variation of hue parameter in HSL color space. This looks nice but the resulting colors have very different lightness as perceived by the user: blue is much darker than e.g. yellow. This results in very uneven distribution of colors across the model which is shown using the colors from the color scale.
Another problem is that while some colors on the color scale are rather distinct, some are quite close and can hardly be distinguished (especially in green part, see attached image).
It is desirable to have a possibility to generate color scales more uniform in terms of lightness (preferably the same for all colors) and differences between neighbor colors (preferably the same), as percieved by the human user.
This should be achievable using CIE Lch color space and CIE Delta E metric, to produce colors with the same lightness and equal distances between the colors.
Another problem is that while some colors on the color scale are rather distinct, some are quite close and can hardly be distinguished (especially in green part, see attached image).
It is desirable to have a possibility to generate color scales more uniform in terms of lightness (preferably the same for all colors) and differences between neighbor colors (preferably the same), as percieved by the human user.
This should be achievable using CIE Lch color space and CIE Delta E metric, to produce colors with the same lightness and equal distances between the colors.
Steps to reproduce
test bugs vis bug31454
Public activity
11 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Thu Mar 19 10:03:40 2020 +0300
Support of CIE Lab and Lch color spaces in Quantity_Color
Enumeration Quantity_TypeOfColor is extended by new values representing CIE Lab and Lch color spaces (with D65 2 deg illuminant).
Conversion of RGB color to and from these color spaces is implemented in Quantity_Color class (using existing interface).
DRAW command vconvertcolor is added to perform relevant conversions.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Thu Mar 19 10:03:40 2020 +0300
Support of CIE Lab and Lch color spaces in Quantity_Color
Enumeration Quantity_TypeOfColor is extended by new values representing CIE Lab and Lch color spaces (with D65 2 deg illuminant).
Conversion of RGB color to and from these color spaces is implemented in Quantity_Color class (using existing interface).
DRAW command vconvertcolor is added to perform relevant conversions.
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Please review branch CR31454. Tests are OK, see Jenkins job CR31454-abv (there are some irrelevant failures - one fail looks like instability, and C# wrapper fails reportedly due to disk space).
Support of CIE Lab and Lch color spaces is introduced in Quantity_Color:
- Enumeration Quantity_TypeOfColor is extended by new values representing CIE Lab and Lch color spaces (with D65 2 deg illuminant).
- Conversion of RGB color to and from these color spaces is implemented in Quantity_Color class (within existing API).
- Color difference calculation using CIE Delta E 200 formula is implemented in method DeltaE2000().
New methods MakeUniformColors() and SetUniformColors() are added in class AIS_ColorScale, generating and setting color scale based on colors of the same lightness in CIE Lch color model.
DRAW commands vcolorconvert and vcolordiff are added to perform conversions and compute difference, respectively.
A new option -uniform is added in DRAW command vcolorscale, to set uniform color scale.
Added test grid v3d colors (color conversions and difference), test bugs vis bug31454 (uniform color scale)
The image Attachment 2 (PNG) shows standard color scale (generated in HSL space) and new uniform one. Note that it was expected that neighbour colors in the uniform color scale should be perceived as equally distant; this is not the case (at least for my eyes and with the monitors I have). This can be investigated further, though I do not see now what else can be impeoved.
Support of CIE Lab and Lch color spaces is introduced in Quantity_Color:
- Enumeration Quantity_TypeOfColor is extended by new values representing CIE Lab and Lch color spaces (with D65 2 deg illuminant).
- Conversion of RGB color to and from these color spaces is implemented in Quantity_Color class (within existing API).
- Color difference calculation using CIE Delta E 200 formula is implemented in method DeltaE2000().
New methods MakeUniformColors() and SetUniformColors() are added in class AIS_ColorScale, generating and setting color scale based on colors of the same lightness in CIE Lch color model.
DRAW commands vcolorconvert and vcolordiff are added to perform conversions and compute difference, respectively.
A new option -uniform is added in DRAW command vcolorscale, to set uniform color scale.
Added test grid v3d colors (color conversions and difference), test bugs vis bug31454 (uniform color scale)
The image Attachment 2 (PNG) shows standard color scale (generated in HSL space) and new uniform one. Note that it was expected that neighbour colors in the uniform color scale should be perceived as equally distant; this is not the case (at least for my eyes and with the monitors I have). This can be investigated further, though I do not see now what else can be impeoved.
Please correct misprints in comments.
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Documentation comments and names of arguments are corrected; test is improved to show several uniform color scales with different lightness and 10 intervals. Please review
Please raise patch in OCCT branch CR31454.
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.
Number of compiler warnings:
No new/fixed warnings
Regressions/Differences/Improvements:
No regressions/differences
CPU differences:
Debian80-64:
OCCT
Total CPU difference: 16868.620000000134 / 16846.320000000138 [+0.13%]
Products
Total CPU difference: 11317.180000000084 / 11306.210000000074 [+0.10%]
Windows-64-VC14:
OCCT
Total CPU difference: 18288.046875 / 18268.796875 [+0.11%]
Products
Total CPU difference: 13120.859375 / 13110.609375 [+0.08%]
Image differences :
No differences that require special attention
Memory differences :
No differences that require special attention
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.
Number of compiler warnings:
No new/fixed warnings
Regressions/Differences/Improvements:
No regressions/differences
CPU differences:
Debian80-64:
OCCT
Total CPU difference: 16868.620000000134 / 16846.320000000138 [+0.13%]
Products
Total CPU difference: 11317.180000000084 / 11306.210000000074 [+0.10%]
Windows-64-VC14:
OCCT
Total CPU difference: 18288.046875 / 18268.796875 [+0.11%]
Products
Total CPU difference: 13120.859375 / 13110.609375 [+0.08%]
Image differences :
No differences that require special attention
Memory differences :
No differences that require special attention
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Related records