toGrayU8

fun ColorBuffer.toGrayU8(target: GrayU8? = null): GrayU8(source)

Converts this ColorBuffer to a grayscale image represented as a GrayU8 object. The red channel of the color buffer is used to calculate the grayscale values.

Return

A GrayU8 instance containing the grayscale representation of the ColorBuffer.

Parameters

target

An optional GrayU8 instance to store the result. If not provided, a new instance will be created.