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

Uploaded Python 3

File details

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

File metadata

  • Download URL: blue_sampler-0.1.14.tar.gz
  • Upload date:
  • Size: 5.0 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.14.tar.gz
Algorithm Hash digest
SHA256 e8e108befc6de9037dc0c4f4d20e1cb458d1ade23f0beb3dcc45e3af6f697dac
MD5 9f710c272c6282cb819dbd71eaf404cf
BLAKE2b-256 653fd9f20849d90ced2af8b4ac2e0775faefb969b73c958c1689fc1f493093d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blue_sampler-0.1.14-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.14-py3-none-any.whl
Algorithm Hash digest
SHA256 29caecf96025e632c002383d4fe78292a2079c903895e6f389667664afd5594d
MD5 6496656374950649798952e7e9734b62
BLAKE2b-256 f8abdcc70e9726179fc728eea89ff96e52c9758548bdbe15ee5aa87e02ec704f

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