View Issue Details

IDProjectCategoryView StatusLast Update
0031454Open CASCADEOCCT:Visualizationpublic2022-04-30 22:23
Reporterabv Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version7.5.0Fixed in Version7.5.0 
Summary0031454: Visualization - perceptually uniform color scale
DescriptionCurrent 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.
Steps To Reproducetest bugs vis bug31454
TagsNo tags attached.
Test case numberbugs/vis/bug22632,bugs/vis/bug31454,v3d/colors/begin,v3d/colors/de2000,v3d/colors/de2000_sharma,v3d/colors/rgb2lab,v3d/colors/rgb2lch,v3d/colors/stability

Attached Files

  • uniform_color_scale.png (3,653 bytes)
  • bug31454.png (11,787 bytes)

Relationships

parent of 0032955 verifiedvpozdyayev Draw Harness, ViewerTest - extend vcolorconvert command to print color in hex format 

Activities

git

2020-03-20 23:33

administrator   ~0091098

Branch CR31454 has been created by abv.

SHA-1: a609901501d279d88250db29223a1b01dcd37bcf


Detailed log of new commits:

Author: abv
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.

git

2020-03-24 23:36

administrator   ~0091225

Branch CR31454 has been updated forcibly by abv.

SHA-1: f4fd5dad14debb330e5c36061c8a6bcdca303d3f

git

2020-03-25 00:50

administrator   ~0091227

Branch CR31454 has been updated forcibly by abv.

SHA-1: 0fdcf1d2ca45dce7a0e1621be95fdce9358d807e

git

2020-03-25 07:41

administrator   ~0091230

Branch CR31454 has been updated forcibly by abv.

SHA-1: ec38b6bce05e1161553210616892bd42cce52ec1

abv

2020-03-25 10:31

manager  

uniform_color_scale.png (3,653 bytes)

abv

2020-03-25 10:50

manager   ~0091232

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 uniform_color_scale.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.

kgv

2020-03-25 13:44

developer   ~0091239

Please correct misprints in comments.

git

2020-03-25 20:37

administrator   ~0091250

Branch CR31454 has been updated forcibly by abv.

SHA-1: fb665b544ede5f805cd7367a18415a996121b68e

abv

2020-03-25 20:39

manager   ~0091251

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

abv

2020-03-25 20:39

manager  

bug31454.png (11,787 bytes)

kgv

2020-03-25 20:43

developer   ~0091252

Please raise patch in OCCT branch CR31454.

bugmaster

2020-03-27 14:54

administrator   ~0091300

Combination -
OCCT branch : WEEK-13
master SHA - 64943a5187fa485536cd2dd1dd4d51b13d189b89
fe4497f3246e6bc1ced97ac331c148f0809ded15
Products branch : WEEK-13 SHA - f10b867b449ebfa55e0a3c8cb276ae511f9cf7f2
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

git

2020-03-28 13:46

administrator   ~0091321

Branch CR31454 has been deleted by inv.

SHA-1: fb665b544ede5f805cd7367a18415a996121b68e

Related Changesets

occt: master 14b741b0

2020-03-19 07:03:40

abv


Committer: bugmaster Details Diff
0031454: Visualization - perceptually uniform color scale

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)
Affected Issues
0031454
mod - src/AIS/AIS_ColorScale.cxx Diff File
mod - src/AIS/AIS_ColorScale.hxx Diff File
mod - src/Quantity/Quantity_Color.cxx Diff File
mod - src/Quantity/Quantity_Color.hxx Diff File
mod - src/Quantity/Quantity_TypeOfColor.hxx Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File
mod - tests/bugs/vis/bug22632 Diff File
add - tests/bugs/vis/bug31454 Diff File
add - tests/v3d/colors/begin Diff File
add - tests/v3d/colors/de2000 Diff File
add - tests/v3d/colors/de2000_sharma Diff File
add - tests/v3d/colors/rgb2lab Diff File
add - tests/v3d/colors/rgb2lch Diff File
add - tests/v3d/colors/stability Diff File
mod - tests/v3d/grids.list Diff File

Issue History

Date Modified Username Field Change
2020-03-20 23:30 abv New Issue
2020-03-20 23:30 abv Assigned To => kgv
2020-03-20 23:33 git Note Added: 0091098
2020-03-24 23:36 git Note Added: 0091225
2020-03-25 00:50 git Note Added: 0091227
2020-03-25 07:41 git Note Added: 0091230
2020-03-25 10:31 abv File Added: uniform_color_scale.png
2020-03-25 10:50 abv Note Added: 0091232
2020-03-25 10:50 abv Status new => resolved
2020-03-25 10:50 abv Steps to Reproduce Updated
2020-03-25 13:44 kgv Note Added: 0091239
2020-03-25 13:44 kgv Assigned To kgv => abv
2020-03-25 13:44 kgv Status resolved => assigned
2020-03-25 20:37 git Note Added: 0091250
2020-03-25 20:39 abv Note Added: 0091251
2020-03-25 20:39 abv Assigned To abv => kgv
2020-03-25 20:39 abv Status assigned => resolved
2020-03-25 20:39 abv File Added: bug31454.png
2020-03-25 20:43 kgv Note Added: 0091252
2020-03-25 20:43 kgv Assigned To kgv => bugmaster
2020-03-25 20:43 kgv Status resolved => reviewed
2020-03-27 14:54 bugmaster Note Added: 0091300
2020-03-27 14:54 bugmaster Status reviewed => tested
2020-03-27 14:56 bugmaster Test case number => bugs/vis/bug22632,bugs/vis/bug31454,v3d/colors/begin,v3d/colors/de2000,v3d/colors/de2000_sharma,v3d/colors/rgb2lab,v3d/colors/rgb2lch,v3d/colors/stability
2020-03-28 13:36 bugmaster Changeset attached => occt master 14b741b0
2020-03-28 13:36 bugmaster Status tested => verified
2020-03-28 13:36 bugmaster Resolution open => fixed
2020-03-28 13:46 git Note Added: 0091321
2020-12-02 16:43 emo Fixed in Version => 7.5.0
2020-12-02 17:12 emo Status verified => closed
2022-04-30 22:23 kgv Relationship added parent of 0032955