< Blue Noise Generator Library - ArtLogic
ArtLogic - Blue Noise Generator Library

Blue Noise Generator Library

Blue noise, originally used in digital halftoning, has attracted renewed attention as its applications have expanded beyond image processing.
The images below compare white noise generated from random numbers with blue noise.
If you notice regular noise patterns, reset your browser zoom level to 100% before viewing.
Animated GIFs of white noise and blue noise using the same threshold
White Noise Blue Noise
White Noise Blue Noise
The differences between white noise and blue noise are summarized below.
      White NoiseBlue Noise
Whether values are randomRandom numbersProcessed random values (not random numbers themselves)
For example, when 30,000 values are generated,
whether duplicate values occur
Duplicates occurNo duplicates
Average value within a rectangular regionVariesNearly constant
Visual characteristicsUneven distributionUniform distribution
Replacing random numbers (such as those from rand or random) with blue noise in two-dimensional processing of images and maps may produce new effects.

Our library supports two-dimensional blue noise, which is used in the following fields (click to expand)
  1. digital halftoning
  2. Halftoning quality comparable to error diffusion can be achieved with a simple, fast array lookup.
    Many printers reproduce full-color images using approximately three to eight ink colors, or grayscale images using only black ink.
    Blue noise is used in printer drivers because it can provide quality comparable to error diffusion with much simpler circuitry.
  3. Route Finding in Navigation Systems and Communication Networks
  4. Alternative routes unaffected by congestion on the original route can be found quickly.
  5. Faster, Higher-Quality AI Image Generation
  6. Using correlated random values to initialize parameters can improve image-generation efficiency in GANs (generative adversarial networks). Blue noise is also a form of correlated random sequence (and, in this description, is not considered mathematically random once correlations are introduced).
  7. Game Character Placement and Gacha Probability Control
  8. The placement of game characters on a two-dimensional map can be controlled as desired.
    Winning probabilities in lotteries or gacha systems can be adjusted as desired.
Generating very large blue-noise matrices previously required enormous computation time, but our library can generate them quickly.
The library source code is published on GitHub as open-source software under the MIT License.
Download the source code (free) here (https://github.com/TakanobuSaito/huge-bluenoise-generator).

Features

(1) Performance

The library generates blue noise as a two-dimensional matrix.
Unlike ordinary random-number generation, the generated values contain no duplicates.
The average value in any rectangular region of the matrix is approximately the same regardless of its position.
With the original void-and-cluster algorithm, generating even a 1024×1024 matrix could take several days. This library generates one in 52 seconds on a typical laptop.
Matrix SizeBlue-Noise Value RangeFile SizeMemory RequiredGeneration Time (Typical Business Laptop)
256×2560~0x0000ffff(0~ 65,535)256KB8 MB approximately1.0 seconds
512×5120~0x0003ffff(0~ 262,143)1MB32 MB approximately5.8 seconds
1024×10240~0x000fffff(0~ 1,048,5754MB128 MB approximately52.2 seconds
2048×20480~0x003fffff(0~ 4,194,303)
Sufficient for most images
16MB512 MB approximately388.5 seconds
4096×40960~0x00ffffff(0~ 16,777,215)
Sufficient for inkjet control in ordinary printers
64MB2just under GB(Limit for a 32-bit build of the library)2315.6 seconds
8192×81920~0x03ffffff(0~ 67,108,863)
Sufficient even for halftoning on very large printers
256MB8just under GB13425.4 seconds
16384×163840~0x0fffffff(0~268,435,455)
So large that practical applications are hard to imagine
1024MB(1GB)32just under GB(Limit of the test laptop)24 hours or less
Download the source code (free) here (https://github.com/TakanobuSaito/huge-bluenoise-generator).

(2) Applications in Dithering

Blue noise was originally used for dithering. Dithering, or digital halftoning, is used to print grayscale images with a single black ink or full-color images with three to eight ink colors.

Original Grayscale Image
Original Grayscale Image
White Noise: Two-Level Halftoning
White Noise: Two-Level Halftoning
Blue Noise: Two-Level Halftoning
Blue Noise: Two-Level Halftoning
Error Diffusion: Two-Level Halftoning
Error Diffusion: Two-Level Halftoning
White Noise: Four-Level Halftoning
White Noise: Four-Level Halftoning
Blue Noise: Four-Level Halftoning
Blue Noise: Four-Level Halftoning
Original Full-Color Image
Original Full-Color Image
Blue Noise: Four-Level Halftoning
Blue Noise: Four-Level Halftoning
Error Diffusion: Four-Level Halftoning
Error Diffusion: Four-Level Halftoning
Download the source code (free) here (https://github.com/TakanobuSaito/huge-bluenoise-generator).

(3) Source Code

Download the source code (free) here (https://github.com/TakanobuSaito/huge-bluenoise-generator).

The library source code is available free of charge.
It is open-source software under the MIT License and may be used commercially, modified, and redistributed freely. The complete source code is included, as detailed below.

  1. Library Source Code (C++/C)
  2. There are no external library dependencies (such as OpenCV). The library can be built using only the supplied source code.
    The library can be built on Windows. Since the core has no Windows dependencies, the static library should also be linkable on Linux (not yet verified).
    The dynamic-link library component is Windows-dependent, but should be straightforward to port to Linux.
  3. Python Sample Programs
  4. Console version of a dynamic-link library import test program
    GUI version of a dynamic-link library import test program

C++ Class Library Reference Manual

Provided as HTML files

Multilanguage Dynamic-Link Library Reference Manual

Provided as HTML files