Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5b37687
Initial rust impl
g4bri3lDev Mar 16, 2026
1a0b4ae
feat(rust): add tone mapping and gamut compression to core
g4bri3lDev Mar 16, 2026
d210290
feat(rust): update bindings
g4bri3lDev Mar 16, 2026
3f54dfe
feat(python): rewrite as maturin mixed Rust/Python package
g4bri3lDev Mar 16, 2026
139f4fd
feat!: replace TypeScript implementation with Rust/WASM core
g4bri3lDev Mar 16, 2026
3a7e5ad
docs: Update READMEs
g4bri3lDev Mar 16, 2026
b4ec828
docs: Update preview site
g4bri3lDev Mar 17, 2026
dfbafb2
feat: add criterion benchmarks
g4bri3lDev Mar 17, 2026
766f41b
fix: optimize tone_map and fix LUT rounding
g4bri3lDev Mar 17, 2026
0503a5e
test: add regression suite with fixture images
g4bri3lDev Mar 17, 2026
8f2e14e
docs: add example images and update READMEs
g4bri3lDev Mar 17, 2026
d1e6222
chore!: unify versioning at 3.0.0 and add crates.io release
g4bri3lDev Mar 17, 2026
081f2c4
feat: derive measured palettes from Rust FFI
g4bri3lDev Mar 17, 2026
5f420c6
refactor(rust): idiomatic Rust patterns in core
g4bri3lDev Mar 17, 2026
8b6686b
fix(rust): replace LCH-weighted matcher with Cartesian OKLab (#28)
g4bri3lDev Apr 27, 2026
1844f3b
fix(rust): apply Bayer threshold in sRGB space (#27)
g4bri3lDev Apr 28, 2026
f74cbff
feat(api)!: flatten v4 API across Rust/Python/JS
g4bri3lDev Apr 28, 2026
3927d79
docs: regenerate examples and update READMEs for v4 API
g4bri3lDev Apr 28, 2026
b24a139
fix(ci): unbreak python build and rust 1.95 clippy
g4bri3lDev Apr 28, 2026
916cb2d
docs: update root README and dev.html for v4 API
g4bri3lDev Apr 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/javascript-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: JavaScript Tests

on:
push:
branches: [main]
paths:
- 'packages/javascript/**'
- 'packages/rust/wasm/**'
- 'packages/rust/core/**'
- '.github/workflows/javascript-test.yml'
pull_request:
paths:
- 'packages/javascript/**'
- 'packages/rust/wasm/**'
- 'packages/rust/core/**'
- '.github/workflows/javascript-test.yml'
workflow_dispatch:

defaults:
run:
working-directory: packages/javascript

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- uses: Swatinem/rust-cache@v2
with:
workspaces: packages/rust

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build WASM
working-directory: .
run: wasm-pack build packages/rust/wasm --target bundler --out-dir ../../javascript/src/wasm-core

- uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install

- name: Type check
run: bun run type-check

- name: Run tests
run: bun run test

- name: Build
run: bun run build
2 changes: 1 addition & 1 deletion .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: uv python install 3.11

- name: Install dependencies
run: uv --project packages/python sync --all-extras
run: uv --project packages/python sync --all-extras --no-install-project

- name: Run prek
run: uv --project packages/python run prek run --all-files --config packages/python/.pre-commit-config.yaml
15 changes: 13 additions & 2 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches: [main]
paths:
- 'packages/python/**'
- 'packages/rust/**'
- '.github/workflows/python-test.yml'
pull_request:
paths:
- 'packages/python/**'
- 'packages/rust/**'
- '.github/workflows/python-test.yml'
workflow_dispatch:

Expand All @@ -33,8 +35,17 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
with:
workspaces: packages/python

- name: Install dependencies
run: uv sync --all-extras
run: uv sync --all-extras --no-install-project

- name: Build and install package
run: uv run maturin develop --release

- name: Run tests
run: uv run pytest tests/ -v --tb=short
Expand All @@ -49,4 +60,4 @@ jobs:
with:
file: ./packages/python/coverage.xml
fail_ci_if_error: false
flags: python
flags: python
137 changes: 102 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,78 +15,145 @@ jobs:
release-please:
runs-on: ubuntu-latest
outputs:
python-release-created: ${{ steps.release.outputs['packages/python--release_created'] }}
python-tag: ${{ steps.release.outputs['packages/python--tag_name'] }}
javascript-release-created: ${{ steps.release.outputs['packages/javascript--release_created'] }}
javascript-tag: ${{ steps.release.outputs['packages/javascript--tag_name'] }}
release-created: ${{ steps.release.outputs['packages/python--release_created'] }}
tag: ${{ steps.release.outputs['packages/python--tag_name'] }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
# Use manifest-based config for monorepo
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

# Publish Python package to PyPI
publish-python:
# ── Rust: publish epaper-dithering-core to crates.io ────────────────────────

publish-rust:
needs: release-please
if: ${{ needs.release-please.outputs.python-release-created }}
if: ${{ needs.release-please.outputs.release-created }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/python
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- name: Set up Python
uses: actions/setup-python@v5
- uses: Swatinem/rust-cache@v2
with:
python-version: "3.11"
workspaces: packages/rust

- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Publish to crates.io
run: cargo publish -p epaper-dithering-core
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

- name: Install dependencies
run: uv sync
# ── Python: build wheels for each platform ──────────────────────────────────

- name: Build package
run: uv build
build-python-wheels:
needs: release-please
if: ${{ needs.release-please.outputs.release-created }}
name: Build wheels (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64
- os: ubuntu-latest
target: aarch64
- os: ubuntu-latest
target: armv7
- os: macos-latest
target: universal2-apple-darwin
- os: windows-latest
target: x86_64
steps:
- uses: actions/checkout@v4

- uses: PyO3/maturin-action@v1
with:
working-directory: packages/python
target: ${{ matrix.target }}
manylinux: auto
args: --release --out dist --find-interpreter
sccache: true

- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.target }}
path: packages/python/dist

build-python-sdist:
needs: release-please
if: ${{ needs.release-please.outputs.release-created }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: PyO3/maturin-action@v1
with:
packages-dir: packages/python/dist/
working-directory: packages/python
command: sdist
args: --out dist

- uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: packages/python/dist

publish-python:
needs: [build-python-wheels, build-python-sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/

# ── JavaScript ───────────────────────────────────────────────────────────────

# Publish JavaScript package to npm
publish-javascript:
needs: release-please
if: ${{ needs.release-please.outputs.javascript-release-created }}
if: ${{ needs.release-please.outputs.release-created }}
runs-on: ubuntu-latest
permissions:
id-token: write # Required for npm provenance
id-token: write
contents: read
defaults:
run:
working-directory: packages/javascript
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- uses: Swatinem/rust-cache@v2
with:
workspaces: packages/rust

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build WASM
working-directory: ${{ github.workspace }}
run: wasm-pack build packages/rust/wasm --target bundler --out-dir ../../javascript/src/wasm-core

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: '25'
registry-url: 'https://registry.npmjs.org'

- name: Setup Bun
uses: oven-sh/setup-bun@v2
- uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install

- name: Run tests
run: bun test
run: bun run test

- name: Build package
run: bun run build
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Rust Tests

on:
push:
branches: [main]
paths:
- 'packages/rust/**'
- '.github/workflows/rust-test.yml'
pull_request:
paths:
- 'packages/rust/**'
- '.github/workflows/rust-test.yml'
workflow_dispatch:

defaults:
run:
working-directory: packages/rust

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
with:
workspaces: packages/rust

- name: Test
run: cargo test --workspace

- name: Clippy
run: cargo clippy --workspace -- -D warnings
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,11 @@ yarn.lock
*.gif
*.bmp
!fixtures/images/
uv.lock
uv.lock

# Python scratch / dev files
packages/python/test.py
packages/python/test_timed.py
packages/python/benchmark.py
packages/python/np_test.py
packages/python/*.pdf
3 changes: 1 addition & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"packages/python": "0.6.4",
"packages/javascript": "2.2.1"
"packages/python": "3.0.0"
}
Loading
Loading