Skip to main content

Stealthy point-pattern sampling on the unit torus

Project description

blue-sampler

Open in Colab

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")

Zebra points

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


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-0.1.16.tar.gz (5.3 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-0.1.16-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blue_sampler-0.1.16.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

Hashes for blue_sampler-0.1.16.tar.gz
Algorithm Hash digest
SHA256 3fc182159c604f20649e41ec984c53d32ecb96ec84dd3ea7e0e3d36c39b962cd
MD5 3e866839324716f6fd97a7bc8fefcc91
BLAKE2b-256 cc63844106c78b22a3978cea6a9277ceb44faf3cfaf7e881f5a48e54d2f74851

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blue_sampler-0.1.16-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

Hashes for blue_sampler-0.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 8f680fcb102b8a4b22a539fd160f3f24d7cc704e4edcac0da21b4ca90629f692
MD5 0ef1ec847614ef33eb78bf50ca932871
BLAKE2b-256 6210f3563f73095aa93244de984b5696c02cf4e4d63724cc52262496e94e379b

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