<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLFeatureValue/init(pixelBuffer:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "c:objc(cs)MLFeatureValue(cm)featureValueWithPixelBuffer:"
  },
  "title" : "init(pixelBuffer:)"
}
-->

# init(pixelBuffer:)

Creates a feature value that contains an image from a pixel buffer.

```
convenience init(pixelBuffer value: CVPixelBuffer)
```

## Parameters

`value`

A <doc://com.apple.documentation/documentation/CoreVideo/cvpixelbuffer-q2e> (Swift) or <doc://com.apple.documentation/documentation/CoreVideo/CVPixelBuffer> (Objective-C) instance.

## Discussion

[`Core ML`](/documentation/CoreML) supports different pixel format types depending on the model’s feature description. For information about `ImageFeatureType`, see [Core ML Format Reference](https://apple.github.io/coremltools/mlmodel/Format/FeatureTypes.html#imagefeaturetype). When the image feature’s color space is `GRAYSCALE`, use <doc://com.apple.documentation/documentation/CoreVideo/kCVPixelFormatType_OneComponent8>; and when it’s `GRAYSCALE_FLOAT16`, use <doc://com.apple.documentation/documentation/CoreVideo/kCVPixelFormatType_OneComponent16Half>; otherwise, use <doc://com.apple.documentation/documentation/CoreVideo/kCVPixelFormatType_32BGRA> when it’s set to `RGB` or `BGR`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)