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.13.tar.gz (12.5 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.13-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blue_sampler-0.1.13.tar.gz
  • Upload date:
  • Size: 12.5 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.13.tar.gz
Algorithm Hash digest
SHA256 d41b021660309c395be12158644f1d310ec682fbbbcc6d75f4d0e875c93132aa
MD5 d9318e2949ad04666c848be0ce1ade48
BLAKE2b-256 74e3b1380d72bd675adf6bc280474dfb3403cc89e1ea416603d91de82a75d222

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blue_sampler-0.1.13-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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 20582425d6b1d8bc002d754e27fbdb718bb99a941270290fa85c936a2f6b5ef2
MD5 bd8040fc2f49738a777ec5bbdd16605f
BLAKE2b-256 2c4e0d9e36d9905572edf417b9e3eb9017c770b6acd590797279c835170bb8f7

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