Add daltonization correction filters (fixes #3)#4
Open
bacloud22 wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
where S is the simulation matrix and E redistributes the lost red-green (or blue-yellow) signal onto channels the observer can still perceive.