@mbtech-nl/bitmap / invertBitmap
Function: invertBitmap()
ts
function invertBitmap(bitmap: LabelBitmap): LabelBitmap;Defined in: transform.ts:137
Swap black and white pixels.
Trailing bits in the last byte of each row stay zero (preserves the LabelBitmap invariant that unused bits are always 0).
Parameters
| Parameter | Type |
|---|---|
bitmap | LabelBitmap |
Returns
A new bitmap with every bit flipped, except trailing padding bits.
Example
ts
const negative = invertBitmap(positive);