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 stippled with stealthy 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.12.tar.gz (12.2 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.12-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blue_sampler-0.1.12.tar.gz
  • Upload date:
  • Size: 12.2 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.12.tar.gz
Algorithm Hash digest
SHA256 c291bd4aca7f96149c8c2fe8d0288aa5eaa9ec09fb1b593f7b5daad9f3fd1495
MD5 0ac49a6ce5090cdd0bf159caf034e7f4
BLAKE2b-256 d7164ccad3fa9379b8fd767a9a119a9c67801428a6667d8bf8253faee2aa1a9d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blue_sampler-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 29.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-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 af051f8096d2f7a9003a8e4698fd076a3ac2f6d9f91c9336ffb08cf189d801df
MD5 d6fa43ca19581a506c6c9379a0c063f6
BLAKE2b-256 d5da9ea87e35d2b7cb81c8667bbe57b2a5dbbded3ee719adf13bb619b6570679

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