• get a grayscale intensity bitmap of multi-channel pixel_buf image buffer, with optional alpha that negates intensity if zero

    Parameters

    • pixels_buf: Uint8Array | Uint8ClampedArray

      flattened pixel bytes

    • channels: number

      number of color channels (ie: bytes per pixel). for instance, you'd use 4 for RGBA, 3 for RGB, 1 for L, 2 for AL, etc...

    • alpha_channel: undefined | number

      specify which channel is the alpha channel, or leave it as undefined to dictate lack of thereof. for instance, you'd use 3 for RGBA, 0 for AL, and undefined for RGB

    • alpha_bias: number = 1

      if alpha is present, you can specify the minimum alpha value required for the pixel to be visible. anything less will make the pixel dull

    Returns Uint8Array

Generated using TypeDoc