Share via


MLImage.CreateFromPixels Method

Definition

Creates MLImage object from the pixel data span.

public static Microsoft.ML.Data.MLImage CreateFromPixels (int width, int height, Microsoft.ML.Data.MLPixelFormat pixelFormat, ReadOnlySpan<byte> imagePixelData);
static member CreateFromPixels : int * int * Microsoft.ML.Data.MLPixelFormat * ReadOnlySpan<byte> -> Microsoft.ML.Data.MLImage
Public Shared Function CreateFromPixels (width As Integer, height As Integer, pixelFormat As MLPixelFormat, imagePixelData As ReadOnlySpan(Of Byte)) As MLImage

Parameters

width
Int32

The width of the image in pixels.

height
Int32

The height of the image in pixels.

pixelFormat
MLPixelFormat

The pixel format to create the image with.

imagePixelData
ReadOnlySpan<Byte>

The pixels data to create the image from.

Returns

MLImage object.

Applies to