Skip to main content

Particle Wave

Turn a static image into an interactive, physics-driven particle cloud in the browser.

The work splits cleanly in two, and so does the distribution:

Package Registry What it does
particle-wave PyPI Offline CLI. Image -> edge/feature map -> sampled point cloud -> .pwcloud
@npmring/particle-wave npm Browser ES module. Loads a .pwcloud, simulates spring physics, renders to canvas

The halves are decoupled by the .pwcloud format, not by a shared runtime: the engine never sees your image, and the tool never sees a canvas. Either one can be swapped as long as the format contract in docs/particle_wave_design.md is honoured.


Repository layout

.
├── pyproject.toml               # particle-wave  (PyPI)
├── LICENSE  CHANGELOG.md
├── docs/                        # design spec, parameter reference, module map
├── scripts/bump_version.py      # keeps both package versions in step
├── sample/                      # sample inputs
└── src/particle_wave/
    ├── __init__.py              # single source of truth for the version
    ├── tool/                    # Python: CLI, pipeline, stages, exporters
    └── FE/                      # @npmring/particle-wave (npm package root)
        ├── package.json
        ├── particle-wave.js     # public entry
        ├── particle-wave.d.ts   # hand-maintained type surface
        ├── engine_fields.json   # config schema for host UIs
        ├── core/ interaction/ utils/ style/
        └── demo/index.html      # live demo with sliders (not published)

src/particle_wave/FE/ is deliberately both a subdirectory of the Python package and the root of the npm package. That is what lets the wheel ship the exact engine build that matches its exporter, so a pip install alone gives you a working pair without vendoring JS separately and keeping the two in step by hand.


Quick start

Convert an image

pip install "particle-wave[cv2]"
particle-wave convert logo.png -o logo.pwcloud
particle-wave inspect logo.pwcloud

Render it

npm install @npmring/particle-wave
<canvas id="pw" style="width:600px;height:400px"></canvas>
<script type="module">
  import ParticleWave from '@npmring/particle-wave';

  const pw = await ParticleWave.init(document.getElementById('pw'), {
    src: '/assets/logo.pwcloud',
    mouseMode: 'repel',
    particleColor: '#7b93ff',
    leftClickMode: 'outward_wave',
  });
</script>

Full API, CLI flags, and the complete config schema live in src/particle_wave/README.md and docs/.


Development

# Python
uv sync --extra dev
uv run pytest
uv run ruff check .

# Frontend (no build step; the published files are the sources)
cd src/particle_wave/FE
npm run check          # syntax-check every module
npm run demo           # serve demo/index.html

Releasing

Both packages share one version number, kept in src/particle_wave/__init__.py. Neither registry lets a version be reused, so the version, the changelog entry, and the tag are all checked before anything is uploaded.

python scripts/bump_version.py 1.4.0     # rewrites __init__.py + FE/package.json
# add the CHANGELOG.md entry, commit, then:
git tag v1.4.0 && git push --tags        # CI builds and publishes both

The tagged workflow needs PYPI_TOKEN and NPM_TOKEN as repository secrets.

To publish from a local checkout instead — for the first release, or to recover when one registry accepted a version and the other did not:

cp .env.example .env && $EDITOR .env     # PYPI_TOKEN, NPM_TOKEN
python scripts/publish.py                # dry run: build + validate, no upload
python scripts/publish.py --publish
python scripts/publish.py --publish --only npm

.env is gitignored and the tokens are never echoed or written into the tree.

License

MIT — see LICENSE.

Metadata

Release files for particle-wave 1.4.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 particle-wave 1.4.0
File Size Uploaded Provenance Actions
particle_wave-1.4.0.tar.gz 102.3 kB Without provenance Details for particle_wave-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for particle-wave 1.4.0
File Interpreter ABI Platform Actions
particle_wave-1.4.0-py3-none-any.whl Python 3 none any Details for particle_wave-1.4.0-py3-none-any.whl

Total release size: 188.3 kB

Release files / particle_wave-1.4.0.tar.gz

Download URL particle_wave-1.4.0.tar.gz
Size 102.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1431cc2ca0deb70cf54aa08babfe84f1f070d87f895b6d0dfd7394bded9c369c
BLAKE2b-256 checksum
How to use checksums
132e3230fb286be94649f7f95c3f9778502d764ad9ff85e2fbbdd50b9b9356e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / particle_wave-1.4.0-py3-none-any.whl

Download URL particle_wave-1.4.0-py3-none-any.whl
Size 86.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aaa855d83e26d8e16105ed0a86a985304664b174f729dfb2c0e8a0b12b4b6a7b
BLAKE2b-256 checksum
How to use checksums
9a8888af5834ccb34926b58941c3beab06537e56e0d39898b5f801839a20738a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for particle-wave 1.4.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.

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files No provenance

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