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 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.11.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.11-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blue_sampler-0.1.11.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.11.tar.gz
Algorithm Hash digest
SHA256 bec4793186778151dd46d50af7a5067cf47b7cb8af47a208c221c5cbb82adae9
MD5 eba22ed017fb107d849fccd345ff0933
BLAKE2b-256 b8c4bec3b4ad6d9bd2455ac1c5d040ede49b3308567f3177319181f7358eed04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blue_sampler-0.1.11-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.11-py3-none-any.whl
Algorithm Hash digest
SHA256 512c78e4ab1248c82e417d1bf5e07f736f29156155cc1516f18de454b76f9430
MD5 a535a4202051dcef5945f93457026c4c
BLAKE2b-256 204194fae8342c2eab650db4a47595c2df764bf3744546c99da5242f51abd61d

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