Ametameric is a project to create 16 color system palettes optimized for dichromats and indirectly trichromats, while retaining most of the initial design of the palette - this is achived by a finding a local optimum near the starting palette with stochastic gradient descent, thus retaining most of the design characteristics of the starting palette.
ametameric.sh is a shell script for initializing
some of these palettes from profile/bashrc for use with terminals supporting
the initialization codes.
Use like this: ./ametameric.sh -q cga
to load the optimized cga palette without showing a banner or
./ametameric.sh -u cga to load the unoptimized cga palette. The same
can be achieved by downloading one of the relevant escape sequence files below and cating it.
Below is a visualization of the worst color pairs in both optimized an non-optimized palettes for the ansi esacpe sequence 16 color palettes on wikipedia .
For some palettes additional constraints are applied like locking more
key-colors than black/white or ensuring blueness.
16 color ANSI palette variant:
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
![]() Download: [.hex | .gpl | .esc] |
My last optimized 16-color palette is the one called 'candy' above, the one called 'pastels' is based on my old ametameric attempt from 2020.
Difficulties in discriminating color among one of the anomalies affects one in 22 persons.
1 in 41 persons with a Y chromosome are full dichromats - as opposed to trichromats and anomalous trichromats their color vision is a 2d plane rather than a 3D RGB cube. Anomalous trichromats vision behaves like a linear blend of normal trichromacy and the related dichromacy. Optimizing for better discrimination somewhat resembles the n-queens problem but in 3d - and directions of movement for the queens only perpendicular to the dichromat planes.
The quality metric maximized for mostly a stochastic gradient descent in parallel for the three dichromats is a weighted sum of color-differences among all pairs scaled by the color difference of the worst pair for each of the three dichromat simulations. The weighting is done to favor pairings with index #0 and index #15. Optionally the engine also supports maximizing luminance (grayscale) contrast.
The source code of the ametameric optimizer, for now - how to build and use it is left as an exercise to the reader.
Dichromacy simulation courtesy of libDaltonLens, CIE lab conversions by babl and visualization of color contast are created using ctx which during development was used as a live debugger/visualizer.
In addition to the terminal palettes I have experimented with gradients also optimized with the engine/visualization.
The temperature gradient, maps to grayscale values when converted with the luminance formula. While hopefully being a discernable gradient for dichromats and trichromats alike.
The rainbow colors are perhaps more useful as a palette than a gradient, but liek the temperature scale it can be a more accesible pseudo-coloring scheme than others that are only tailoring for trichormats.