Skip to content

Add daltonization correction filters (fixes #3)#4

Open
bacloud22 wants to merge 1 commit into
masterfrom
fix/colorblind-correction-filters
Open

Add daltonization correction filters (fixes #3)#4
bacloud22 wants to merge 1 commit into
masterfrom
fix/colorblind-correction-filters

Conversation

@bacloud22

Copy link
Copy Markdown
Owner

The Protanopia/Deuteranopia/Tritanopia filters were colour-blindness simulation matrices: they collapse colours onto the confusion axis to show how a deficient observer sees, rather than helping them distinguish colours. Applying them made things worse for the deutan user in #3, while Microsoft's filter (which daltonizes) scored perfectly.

Add proper correction filters. The Magnification API only takes a single linear 5x5 matrix, so a LAB LUT (as in daltoLAB) is not usable directly, but daltonization is linear and collapses to one matrix:

Correction = I + (I - S) * E

where S is the simulation matrix and E redistributes the lost red-green (or blue-yellow) signal onto channels the observer can still perceive.

  • Transform.cs: add Add/Subtract/Identity/Daltonize helpers
  • Matrices.cs: add Protanopia/Deuteranopia/TritanopiaCorrection
  • Program.cs: register the new filters; extend the menu letter list
  • greys.csproj: bump net6.0 (EOL) -> net8.0-windows

The Protanopia/Deuteranopia/Tritanopia filters were colour-blindness
*simulation* matrices: they collapse colours onto the confusion axis to
show how a deficient observer sees, rather than helping them distinguish
colours. Applying them made things worse for the deutan user in #3, while
Microsoft's filter (which daltonizes) scored perfectly.

Add proper correction filters. The Magnification API only takes a single
linear 5x5 matrix, so a LAB LUT (as in daltoLAB) is not usable directly,
but daltonization is linear and collapses to one matrix:

    Correction = I + (I - S) * E

where S is the simulation matrix and E redistributes the lost red-green
(or blue-yellow) signal onto channels the observer can still perceive.

- Transform.cs: add Add/Subtract/Identity/Daltonize helpers
- Matrices.cs: add Protanopia/Deuteranopia/TritanopiaCorrection
- Program.cs: register the new filters; extend the menu letter list
- greys.csproj: bump net6.0 (EOL) -> net8.0-windows

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants