Stealthy point-pattern sampling on the unit torus
Project description
blue-sampler
Generate large stealthy point patterns on the unit torus [0, 1)^D.
Stealthy point patterns have vanishing density fluctuations at low ("blue") frequencies, making them useful for Monte Carlo integration, image stippling, and any application that needs well-spread, low-discrepancy points.
The blue noise sampler implemented here have linear complexity in the number of points and the dimension, and run in under 15 minutes for 1 million 2D points.
Installation
pip install blue_sampler
Quick start
import blue_sampler as blue
# 10 000 points in 2-D
x = blue.sample_points(N=10_000)
blue.plot(x)
blue.plot_structure_factor(x)
# arbitrary dimension D
x = blue.sample_points(N=2_000, D=5)
# image stippling
x = blue.im2points(image="zebra.jpg")
Supported dimensions
| D | Notes |
|---|---|
| 2 | Fast, recommended for exploration |
| 3 | ~2x slower than 2-D |
| 4–5 | Requires more iterations |
| ≥ 6 | Experimental, for small sample sizes |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blue_sampler-0.1.15.tar.gz.
File metadata
- Download URL: blue_sampler-0.1.15.tar.gz
- Upload date:
- Size: 5.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5536b03035e5977ab7a24fe41eacf153264394a9ea2c9896598e7ee0e9e39337
|
|
| MD5 |
04c523e4e59578cbc0c03ef316f99b58
|
|
| BLAKE2b-256 |
95746907371b1f7cc5f1f096c17b57e716468c11aa4af7f1f54f55380a745bb8
|
File details
Details for the file blue_sampler-0.1.15-py3-none-any.whl.
File metadata
- Download URL: blue_sampler-0.1.15-py3-none-any.whl
- Upload date:
- Size: 30.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1f0f1f19a76719aa47207e7e1ec722438b51a461160886e1a9353b19866e109
|
|
| MD5 |
d738d4c938c98b84ce0639a6ae1c5c54
|
|
| BLAKE2b-256 |
caca3ba90b79a36cced3de11d9f59b2716cebd4e26b23fff673837f758920789
|