achromatopsia
Simulate total color blindness (achromatopsia / complete monochromacy) — the world in pure luminance. A color, or a whole image, collapsed to the gray of the same brightness.
pip install achromatopsia
import "achromatopsia"
achromatopsia.simulate("#d7191c"); // "#7f7f7f" — the equiluminant gray
const png = achromatopsia.simulateImage("./chart.png");
require("fs").writeFileSync("chart-gray.png", png);
simulate(color)→ the gray hex of the same WCAG relative luminance.simulateImage(input, opts?)→ a grayscale PNG Buffer (PNG/JPEG in; path, Buffer, or data URI).opts.maxSidecaps the longest side (default 2000).
Luminance is opticquiz-cvd's relLuminance, re-encoded to sRGB gray. This is the total-monochromacy end; for the dichromacies see dichromacy. A simulation, not a diagnosis.
Licence
MIT.
Metadata
Release files for achromatopsia 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 | |
|---|---|---|---|
| achromatopsia-0.1.0.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| achromatopsia-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.6 kB
Release files / achromatopsia-0.1.0.tar.gz
| Download URL | achromatopsia-0.1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33401f21d63d5adb4ba08a101911dcb4b12ccbac37f48c18d6a472944c85f5f4
|
|
BLAKE2b-256 checksum How to use checksums |
bc61b17e732b9d429848f6edf5dee2338ada65f0b90deee453377911c65a9737
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / achromatopsia-0.1.0-py3-none-any.whl
| Download URL | achromatopsia-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc4035e79052666656cc425d4769a939994e072a749adc1eeb0e3e7b5409fd74
|
|
BLAKE2b-256 checksum How to use checksums |
653cd50d91a6d9e2c9fdf02519df49329be5d2e43f4bbe610cd9b3a9f2bdf602
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|