@mbtech-nl/bitmap / ImageRenderOptions
Interface: ImageRenderOptions
Defined in: types.ts:44
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
autoLevels? | boolean | Stretch the luminance histogram so the darkest visible pixel becomes 0 and the brightest becomes 1, before gamma and threshold/dither. Applied per-image; flat (all-same-value) inputs are passed through. Default false | types.ts:79 |
dither? | boolean | DitherMethod | Dither method. - false (default): no dithering, hard threshold at threshold. - true: alias for 'floyd-steinberg' (backward compatible with v1.0). - method string: use the named algorithm. Default false | types.ts:59 |
gamma? | number | Gamma correction applied to luminance before threshold/dither. Output = pow(L, gamma). - gamma < 1 brightens midtones. - gamma > 1 darkens midtones. - gamma === 1 is a no-op. Must be a finite positive number; non-finite or non-positive values throw. Default 1 | types.ts:90 |
invert? | boolean | Invert the output bitmap. Default false | types.ts:65 |
luminanceWeights? | LuminanceWeights | RGB → luminance weights. - 'bt709' (default): 0.2126 / 0.7152 / 0.0722 — current behaviour. - 'bt601': 0.299 / 0.587 / 0.114 — older NTSC standard. - tuple: custom non-negative weights; must sum to ~1.0 (validated, ±1e-6 tolerance). Default 'bt709' | types.ts:99 |
rotate? | 0 | 90 | 180 | 270 | Rotate the rendered bitmap. Applied last, after threshold/dither. Default 0 | types.ts:71 |
threshold? | number | Threshold for black/white conversion (0–255). Ignored when dither is set to a method or true; dither methods always quantise at the midpoint. Default 128 | types.ts:50 |