daltoscope
See a color, a palette, or a whole image the way a colorblind person does. Where hueristic
judges whether colors are safe, daltoscope shows you — it recolors a hex, or an entire
PNG/JPEG, as protanopia, deuteranopia, or tritanopia renders it.
pip install daltoscope # colors only
pip install "daltoscope[image]" # + image recoloring (Pillow, numpy)
import daltoscope as dalton
dalton.simulate("#d7191c", "deutan") # "#8a7b0c" — that warning red, to a deuteranope
dalton.simulate_all("#1a9641") # {"protan": "#988839", "deutan": "#8a7f48", "tritan": "#009383"}
from PIL import Image
sim = dalton.simulate_image(Image.open("dashboard.png"), "deutan")
sim.save("dashboard-deutan.png")
API
simulate(color, type, severity=1.0)→ the color as one deficiency sees it, as hex.typeis"protan","deutan", or"tritan".simulate_all(color, severity=1.0)→{"protan": ..., "deutan": ..., "tritan": ...}.simulate_image(image, type, severity=1.0)→ a recolored PILImage(alpha preserved).imageis a PILImageor a file path.severity(0..1) shows partial deficiency (anomalous trichromacy), not only the full dichromat case.
How it works
daltoscope is a thin lens over opticquiz-cvd: every
pixel's transform is that engine's simulate(), using the Machado, Oliveira & Fernandes (2009)
deficiency matrices. simulate_image passes each distinct color through the engine once via a
lookup table, so a photograph is not thousands of redundant calls — and there is never a second
copy of the colorimetry to drift. Method, open access:
https://doi.org/10.5281/zenodo.21310578
Not a clinical tool
A simulation for design and communication — it approximates how deficient color vision renders an image. It is not a diagnosis, and no on-screen rendering is exact for a given individual.
Licence
MIT.
Metadata
Release files for daltoscope 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| daltoscope-0.1.0.tar.gz | 4.6 kB | Without provenance | Details for daltoscope-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| daltoscope-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for daltoscope-0.1.0-py3-none-any.whl |
Total release size: 9.4 kB
Release files / daltoscope-0.1.0.tar.gz
| Download URL | daltoscope-0.1.0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
592098928908b4af03e00ff4ae1fe81f9813db6307d08ac771df16e1d1bdc652
|
|
BLAKE2b-256 checksum How to use checksums |
94797af5e969add0c7b110c7fd55aba7e2a7c064feb3255be816d9f19824e317
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / daltoscope-0.1.0-py3-none-any.whl
| Download URL | daltoscope-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d56fb593d6a9cc4fde5594d3f0a3ee18aa12b351cd2dce11d9487a1a480d71ac
|
|
BLAKE2b-256 checksum How to use checksums |
9bb17d37bf3677cb35e1813d0702637a8b93d064a4661ca846774d93da651863
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for daltoscope 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.