Skip to main content

Large points sampling on the unit torus [0, 1)^D, either with uniform blue noise propriety (vanishing density fluctuations) or with target density (stippling)

Project description

PyPI Docs GitHub Open in Colab

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 main blue noise sampler (RGBN) 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 2D
x = blue.sample_points(N=10_000, D=2)
blue.plot(x, auto_zoom=True)

# structure factor visualization
blue.plot_structure_factor(x)

# higher dimensions
x = blue.sample_points(N=2_000, D=5)

# image stippling
x = blue.im2points(image="zebra.jpg")

🖼️ Example

Zebra points


📊 Supported dimensions

Dimension Notes
2D Fast, recommended
3D ~2× slower
4–5D Works, more iterations needed
≥6D Experimental (small N recommended)

📚 Links


📄 License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blue_sampler-1.0.0.tar.gz (5.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blue_sampler-1.0.0-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

Details for the file blue_sampler-1.0.0.tar.gz.

File metadata

  • Download URL: blue_sampler-1.0.0.tar.gz
  • Upload date:
  • Size: 5.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for blue_sampler-1.0.0.tar.gz
Algorithm Hash digest
SHA256 095fada3bc19682f5eff0c9a1f654e8f1168ade460f43d35a842f044b3a64b58
MD5 b111b1fc93ce9b6b4fc52d1ee97fa3a8
BLAKE2b-256 9d3f308dae99926c3dde5d3f5a6eb7e7a744bf895047a0dd26d1684eec438385

See more details on using hashes here.

File details

Details for the file blue_sampler-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: blue_sampler-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 33.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for blue_sampler-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9db392978246be0b4d5deaa44b6e3d1d530ea2346d6c77fbe9b537e2faaff2c
MD5 ee6492a5fdd93a7a0408f8019abdb15c
BLAKE2b-256 95e3780332457c0aa17b6e0e7b4e797004553dab0dd9dd220beca4b0cf7aecb5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page