Table of Contents

Method ConvertGRAY8

Namespace
LMKit.Media.Image
Assembly
LM-Kit.NET.dll

ConvertGRAY8()

Creates a new ImageBuffer with pixel data converted to 8-bit grayscale (GRAY8).

public ImageBuffer ConvertGRAY8()

Returns

ImageBuffer

A new ImageBuffer instance with grayscale pixel data.

Remarks

When converting from RGB24 or RGBA32, the grayscale value of each pixel is computed using a weighted luma formula that approximates human brightness perception (commonly based on ITU-R BT.601 coefficients).

If the image is already in grayscale, this method produces a deep copy of the image data.

Exceptions

InvalidOperationException

Thrown if the native conversion fails.

ObjectDisposedException

Thrown if this instance has been disposed.