Skip to main content

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. type is "protan", "deutan", or "tritan".
  • simulate_all(color, severity=1.0) → {"protan": ..., "deutan": ..., "tritan": ...}.
  • simulate_image(image, type, severity=1.0) → a recolored PIL Image (alpha preserved). image is a PIL Image or 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)

Source distribution for daltoscope 0.1.0
File Size Uploaded
daltoscope-0.1.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for daltoscope 0.1.0
File Interpreter ABI Platform
daltoscope-0.1.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page