Bayer 4×4 Dither Threshold Matrix Lookup
Apply Bayer 4×4 ordered thresholds (rank+0.5)/16 to actual normalized gray image using explicit tile origin; strict greater-than threshold, no error diffusion, printer dot-gain model or luminance conversion implied.
Description
Bayer ordered dithering repeats a 4×4 threshold pattern.
Bayer ordered dithering repeats a 4×4 threshold pattern. A tile origin controls alignment without error diffusion.1
Enter a nonempty rectangular normalized gray matrix 0–1 and nonnegative safe-integer x/y origin. Use ranks[[0,8,2,10],[12,4,14,6],[3,11,1,9],[15,7,13,5]] with modulo 4 origin. Return binary pixels; exact threshold equality gives 0.
When to use Bayer 4×4 Dither Threshold Matrix Lookup
Use Bayer 4×4 Dither Threshold Matrix Lookup when you need to evaluate the supplied records under the calculation and evidence rules below. No dot-gain model, luminance conversion or error-diffusion processing is supplied.
Prepare colors in the stated color space and scale. Use encoded RGB fractions, linear RGB, Lab, xy, byte values or ink percentages exactly as requested; supply caller tolerances and reference conditions.
How to use Bayer 4×4 Dither Threshold Matrix Lookup and understand its results
- Prepare colors in the stated color space and scale. Use encoded RGB fractions, linear RGB, Lab, xy, byte values or ink percentages exactly as requested; supply caller tolerances and reference conditions.
- Enter normalizedGrayPixels, originPixelX, originPixelY using the field table and calculation rules, then run the tool.
- Read binaryDitherPixels. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| normalizedGrayPixels | Normalized gray pixels | list of list of number | Required |
| originPixelX | Origin pixel x | number | Required |
| originPixelY | Origin pixel y | number | Required |
Enter a nonempty rectangular normalized gray matrix 0–1 and nonnegative safe-integer x/y origin. Use ranks[[0,8,2,10],[12,4,14,6],[3,11,1,9],[15,7,13,5]] with modulo 4 origin. Return binary pixels; exact threshold equality gives 0.
white=gray>(BayerRank+0.5)/16 Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| binaryDitherPixels | Binary dither pixels | list of list of number |
{
"input": {
"normalizedGrayPixels": [
[
0.5,
0.5
],
[
0.5,
0.5
]
],
"originPixelX": 0,
"originPixelY": 0
},
"output": {
"binaryDitherPixels": [
[
1,
0
],
[
0,
1
]
]
}
} Limitations and assumptions
No dot-gain model, luminance conversion or error-diffusion processing is supplied.
Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Matrices are limited to 128 rows and 128 entries per row. Numeric lists are limited to 10,000 entries; string lists to 128 strings of at most 128 characters each. The rules above may impose smaller limits. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use E-Ink 16-Level Grayscale Map: Sixteen-level grayscale quantization needs a declared code polarity. Reconstructed gray is independent of that device convention. For a complementary task, use Web-Safe 216 Nearest Index: The legacy web-safe palette is a six-level RGB cube. Channel rounding gives an explicit red-major index.
References
-
Bayer 4×4 Dither Threshold Matrix Lookup — tool.io
Similar or alternative tools
- E-Ink 16-Level Grayscale Map
Sixteen-level grayscale quantization needs a declared code polarity. Reconstructed gray is independent of that device convention.
- Web-Safe 216 Nearest Index
The legacy web-safe palette is a six-level RGB cube. Channel rounding gives an explicit red-major index.