epaper-colorcal
Measure the real colours of an e-paper panel with a CHNSpec CR30 colorimeter and turn them
into a palette file for OpenDisplay's epaper-dithering.
Seat the CR30 on the panel once; the tool shows each ink on the panel over Bluetooth, reads its
spectral reflectance, and prints an epaper-palette file. With the CR30 on Bluetooth too, the
whole measurement is wireless.
uvx --python 3.13 --from 'epaper-colorcal[ble,opendisplay]' epaper-colorcal \
--scheme BWGBRY --id spectra6_7in3 \
--interactive --address OD216205 --cr30-ble > spectra6_7in3.json
Why
Dithering needs to know what the panel's inks really look like. OpenDisplay's earlier palettes came from phone photos of the panel, and they vary a lot with the camera, the lighting and the RAW processing. The CR30 (about €55) is a pocket spectrocolorimeter: it lights the sample itself at 45° and reads the reflected spectrum in 31 bands from 400 to 700 nm. Room light doesn't matter, and the result is the panel's physical reflectance, from which any colour space can be computed.
How good is it? On our unit the colour we compute from its spectrum matches the CR30's own display to ΔE 0.05, and repeated reads of a panel agree to about ΔE 0.1.
What you need
- A CHNSpec CR30, connected over USB or Bluetooth.
- For automatic measurement: the panel on an OpenDisplay board reachable over Bluetooth. Without one you can show each ink yourself (manual mode).
- Python 3.11+ (3.13+ for automatic mode, which needs
py-opendisplay).
Install
Nothing to install with uv: uvx runs the tool from PyPI in a
throwaway environment. Name the extras you need (below):
# Automatic mode, everything over Bluetooth (py-opendisplay needs Python 3.13+)
uvx --python 3.13 --from 'epaper-colorcal[ble,opendisplay]' epaper-colorcal --help
# Manual mode, CR30 on USB
uvx --from 'epaper-colorcal[serial]' epaper-colorcal --help
To install it instead: uv tool install --python 3.13 'epaper-colorcal[ble,opendisplay]' (or pip install),
then run epaper-colorcal. For development, clone the repo and uv sync --all-extras.
The extras:
| Extra | Adds | Needed for |
|---|---|---|
serial |
pyserial-asyncio |
the CR30 over USB (--port) |
ble |
bleak |
the CR30 over Bluetooth (--cr30-ble) |
opendisplay |
py-opendisplay |
automatic mode (--interactive) |
--dry-run and the tests need none of them.
The commands below use uv run epaper-colorcal (from a clone); with uvx or an installed
tool, put uvx --from '…' epaper-colorcal or epaper-colorcal in its place.
Connecting the CR30
Bluetooth: switch the CR30 on and pass --cr30-ble. It finds the CR30 by scanning, or
give its name (shown on its screen and advertised, e.g. --cr30-ble CM454M1246).
USB: plug it in and pass its serial port with --port. The CR30 uses a CH34x USB-serial
chip:
| OS | Port |
|---|---|
| macOS | /dev/tty.wchusbserial* (or /dev/tty.usbserial-*) |
| Linux | /dev/ttyUSB0 |
| Windows | COM3 (check Device Manager) |
Calibration is automatic: the CR30 calibrates against the white reference inside its cap.
--calibrate runs an explicit black and white calibration first (USB only); keep the cap
closed for both steps.
Measuring a panel
Record the panel's temperature. E-paper colours shift with temperature, so a palette is
only valid near the temperature it was measured at. Pass it with --temp; in automatic mode,
without --temp, the tool uses the temperature the OpenDisplay board advertises (its chip
sensor, read before connecting, which is close to room temperature on an idle board).
Automatic (recommended)
Seat the CR30 flat on the panel, away from the edges, and run:
uv run epaper-colorcal --scheme BWGBRY --id spectra6_7in3 \
--note "Spectra 6 7.3in" \
--interactive --address OD216205 \
--cr30-ble \
--out spectra/spectra6_7in3.json > spectra6_7in3.json
For each ink the tool fills the screen with it, waits for the refresh to finish, takes --count
reads (default 3) and averages them. A six-colour Spectra panel takes about 9 minutes, mostly
panel refreshes. The CR30 stays put, so every ink is measured at the same spot.
--addressis the OpenDisplay board's name (e.g.OD216205), MAC or macOS UUID.--key <hex>if the board is encrypted.- Use
--port <port>instead of--cr30-blefor a USB-connected CR30.
Each ink is sent as its nominal colour (#ff0000 for red, …), which epaper-dithering always
maps to that ink, so the measurement never depends on whatever palette the board already uses.
The tool checks the screen really is one ink before uploading.
Manual
Without an OpenDisplay board, show each ink yourself: fill the screen with the ink's nominal colour and send it undithered. Then:
uv run epaper-colorcal --scheme BWRY --id my_panel --temp 21 --port /dev/ttyUSB0 > my_panel.json
The tool asks for each ink in order. Show it, seat the CR30, press Enter.
Try it without hardware
uvx epaper-colorcal --scheme BWGBRY --id TEST --temp 23 --dry-run
uvx epaper-colorcal --scheme BWGBRY --id TEST --temp 23 --interactive --dry-run
Output
stdout is an epaper-palette file, ready for epaper-dithering 7 (prompts and notes go to stderr):
{
"format": "epaper-palette",
"version": 1,
"measured": true,
"source": "Spectra 6 7.3in; CHNSpec CR30 s/n CM454M1246, measured 2026-11-19, D65/2°, panel at 18.5°C",
"entries": [
{ "appearance": [25.1, 15.2, -13.4], "name": "black", "nominal": "#000000" },
{ "appearance": [100.0, 0.0, 0.0], "name": "white", "nominal": "#ffffff" },
...
]
}
Each appearance is CIE Lab under D65/2°, normalised so the panel's white is L* 100 (that's
what epaper-dithering expects; the tool uses its own Palette.from_absolute_lab to do it).
Inks outside sRGB keep their measured colour.
Use it with:
- py-opendisplay: copy the file into
src/opendisplay/palettes/and add the panel toMEASURED_PALETTE_FILESindisplay_palettes.py. - epaper-dithering directly:
Palette.load("spectra6_7in3.json"). - To share a measurement, add it to
epaper-dithering'sexamples/palettes/.
--out writes a sidecar with the raw spectra of every read, plus sRGB and D50 Lab per ink
(for datasheet comparison), so a measurement can be re-processed later without re-measuring.
Options
| Option | |
|---|---|
--scheme |
MONO, BWR, BWY, BWRY or BWGBRY; inks are measured in the firmware's index order |
--id |
a name for the measurement (stored in the sidecar) |
--temp |
panel temperature in °C (automatic mode: defaults to the board's advertised temperature) |
--note |
free text put at the start of the palette's source, e.g. the panel model |
--count |
reads averaged per ink (default 3) |
--port / --cr30-ble [NAME] |
the CR30 over USB / Bluetooth |
--calibrate |
explicit black/white calibration first (USB) |
--interactive, --address, --key, --settle |
automatic mode via an OpenDisplay board |
--out |
raw-spectra sidecar path |
--dry-run |
synthetic spectra, no hardware |
How it works
CR30 (USB or BLE) ─► 31-band reflectance, % ─► colour-science: XYZ & Lab, D65/2°
│
epaper_dithering.Palette.from_absolute_lab ◄┘ ─► epaper-palette JSON
epaper_colorcal.cr30 is a small, typed client for the CR30 over both transports; see
docs/cr30-protocol.md for the protocol. Colour maths is done here
with colour-science, not by the device.
Temperature
The tool records the temperature (from --temp or the board); it doesn't compensate for it. Measuring a panel at a few
temperatures and interpolating is the planned next step, and the sidecars are structured for it.
See docs/temperature-compensation.md.
Development
uv sync --all-extras
uv run pytest -q
uv run prek run --all-files # ruff, ruff-format, mypy (strict), pylint
The protocol tests replay frames captured from a real CR30 over both transports
(tests/fixtures/cr30_frames.json), so they need no hardware.
Credits
The CR30's USB serial protocol was reverse-engineered by itohio
(write-up,
color-science); this project's client is its own
implementation, built on that work and verified against a device.
Metadata
Release files for epaper-colorcal 0.2.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 |
|---|---|---|---|---|
| epaper_colorcal-0.2.0.tar.gz | 136.7 kB | With provenance | Details for epaper_colorcal-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| epaper_colorcal-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for epaper_colorcal-0.2.0-py3-none-any.whl |
Total release size: 163.3 kB
Release files / epaper_colorcal-0.2.0.tar.gz
| Download URL | epaper_colorcal-0.2.0.tar.gz |
|---|---|
| Size | 136.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78f508a82c00899992d1845887b8c53235aeb1ce1ffc27f7a9ab2d51abdf0724
|
|
BLAKE2b-256 checksum How to use checksums |
534b253d5cac7ba14a05c01188165a72b8856cb58475d3f4f77fbb563819c0e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logRelease files / epaper_colorcal-0.2.0-py3-none-any.whl
| Download URL | epaper_colorcal-0.2.0-py3-none-any.whl |
|---|---|
| Size | 26.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
db92b9e805520ec588bbe23497cbf8a8b7e55c2e0dbfd34970a442acecdb6e63
|
|
BLAKE2b-256 checksum How to use checksums |
f6b4fc6f7286d9f6c5172664695925ebb937dfa2bde84b759792f99ff71273e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logSecurity for epaper-colorcal 0.2.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for epaper_colorcal-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logA 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.