Skip to main content

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 (per gradient step), and run in under 10 minutes for 1 million points 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


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.10.tar.gz (11.9 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.10-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blue_sampler-0.1.10.tar.gz
  • Upload date:
  • Size: 11.9 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.10.tar.gz
Algorithm Hash digest
SHA256 b11686ccf16b5d3c04f553aad38ce3a5c86a4552955014fddac8943736880560
MD5 4049c17ad2f52ea778e6c2e8f4cc6331
BLAKE2b-256 7f79ff9faad2e07b34429f5ace58fc665a1b216262b2e2a6e57ab6ccf53f4c0c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blue_sampler-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 29.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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 eae5104e3f9d1eb256d8740dffba3a031d19683d61e6ebf1783367215f2280fd
MD5 4b28b3549dad925009f218b6ef4021b5
BLAKE2b-256 58544e4c87e19c05db3ec7f5e9366d6e1bbcc68e0fc81fbe817d628803544e21

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