<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLFeatureValue/init(cgImage:pixelsWide:pixelsHigh:pixelFormatType:options:)-1pdp4",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core ML",
      "CoreML"
    ],
    "preciseIdentifier" : "c:objc(cs)MLFeatureValue(cm)featureValueWithCGImage:pixelsWide:pixelsHigh:pixelFormatType:options:error:"
  },
  "title" : "init(cgImage:pixelsWide:pixelsHigh:pixelFormatType:options:)"
}
-->

# init(cgImage:pixelsWide:pixelsHigh:pixelFormatType:options:)

Construct image feature value from CGImage (orientation is assumed to be kCGImagePropertyOrientationUp)

```
convenience init(cgImage: CGImage, pixelsWide: Int, pixelsHigh: Int, pixelFormatType: OSType, options: [MLFeatureValue.ImageOption : Any]? = nil) throws
```

---

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)