@oazmi/kitchensink - v0.9.13
    Preparing search index...

    Function intensityBitmap

    • get a grayscale intensity bitmap of multi-channel pixel_buf image buffer, using an optional alpha_channel number to mask off the resulting intensity wherever the masking channel is zero (or less than the optional alpha_bias parameter).

      Parameters

      • pixels_buf: Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike>

        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...

      • Optionalalpha_channel: 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