floatArrayToBufferedImage

fun floatArrayToBufferedImage(inputArray: FloatArray, outputShape: ImageShape, arrayColorMode: ColorMode, isNormalized: Boolean): BufferedImage

Converts inputArray of type FloatArray to BufferedImage with outputShape provided.

The output BufferedImage will have the same ColorMode as arrayColorMode of an input tensor.

If isNormalized is true, then inputArray values considered to be in [0..1) interval and will be rescaled to [0..255) interval.

If an array requires custom processing, one can use method variation that accepts ArrayTransform.

Return

BufferedImage result image.

Parameters

inputArray

float array to convert.

outputShape

shape of the output image.

arrayColorMode
isNormalized

Boolean that indicates inputArray should be rescaled to [0..255) interval.

fun floatArrayToBufferedImage(inputArray: FloatArray, outputShape: ImageShape, arrayColorMode: ColorMode, arrayTransform: ArrayTransform? = null): BufferedImage

Converts inputArray of type FloatArray to BufferedImage with outputShape provided. If a custom arrayTransform is needed, lambda or ArrayTransform can be provided.

The output BufferedImage will have the same ColorMode as arrayColorMode of an input tensor.

If an arrayTransform is given, then arrayColorMode is interpreted as a color mode of an array after transform.

inputArray is explicitly copied before applying arrayTransform.

Return

BufferedImage result image.

See also

Parameters

inputArray

float array to convert.

outputShape

shape of the output image.

arrayColorMode
arrayTransform

ArrayTransform implementation. Thanks to Kotlin SAM convention it can be supplied as (FloatArray) -> FloatArray lambda.