<!--
{
  "documentType" : "article",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLFeatureValue/MLFeatureValue-Implementations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "MLFeatureValue Implementations"
}
-->

# MLFeatureValue Implementations

## Topics

### Initializers

[`convenience init(CGImage: CGImage, constraint: MLImageConstraint, options: [MLFeatureValue.ImageOption : Any]?) throws`](/documentation/CoreML/MLFeatureValue/init(CGImage:constraint:options:)-1j00l)

Creates a feature value that contains an image defined by a core graphics image and a constraint.

[`convenience init(CGImage: CGImage, orientation: CGImagePropertyOrientation, constraint: MLImageConstraint, options: [MLFeatureValue.ImageOption : Any]?) throws`](/documentation/CoreML/MLFeatureValue/init(CGImage:orientation:constraint:options:)-87vk0)

Creates a feature value that contains an image defined by a core graphics image, an orientation, and a constraint.

[`convenience init(CGImage: CGImage, orientation: CGImagePropertyOrientation, pixelsWide: Int, pixelsHigh: Int, pixelFormatType: OSType, options: [MLFeatureValue.ImageOption : Any]?) throws`](/documentation/CoreML/MLFeatureValue/init(CGImage:orientation:pixelsWide:pixelsHigh:pixelFormatType:options:)-4nme0)

Creates a feature value that contains an image defined by a core graphics image and its orientation, size, and pixel format.

[`convenience init(CGImage: CGImage, pixelsWide: Int, pixelsHigh: Int, pixelFormatType: OSType, options: [MLFeatureValue.ImageOption : Any]?) throws`](/documentation/CoreML/MLFeatureValue/init(CGImage:pixelsWide:pixelsHigh:pixelFormatType:options:)-2zg43)

Creates a feature value that contains an image defined by a core graphics image and its size and pixel format.

[`convenience init(imageAtURL: URL, constraint: MLImageConstraint, options: [MLFeatureValue.ImageOption : Any]?) throws`](/documentation/CoreML/MLFeatureValue/init(imageAtURL:constraint:options:))

Creates a feature value that contains an image defined by an image URL and a constraint.

[`convenience init(imageAtURL: URL, orientation: CGImagePropertyOrientation, constraint: MLImageConstraint, options: [MLFeatureValue.ImageOption : Any]?) throws`](/documentation/CoreML/MLFeatureValue/init(imageAtURL:orientation:constraint:options:))

Creates a feature value that contains an image defined by an image URL, an orientation, and a constraint.

[`convenience init(imageAtURL: URL, orientation: CGImagePropertyOrientation, pixelsWide: Int, pixelsHigh: Int, pixelFormatType: OSType, options: [MLFeatureValue.ImageOption : Any]?) throws`](/documentation/CoreML/MLFeatureValue/init(imageAtURL:orientation:pixelsWide:pixelsHigh:pixelFormatType:options:))

Creates a feature value that contains an image defined by an image URL and the image’s orientation, size, and pixel format.

[`convenience init(imageAtURL: URL, pixelsWide: Int, pixelsHigh: Int, pixelFormatType: OSType, options: [MLFeatureValue.ImageOption : Any]?) throws`](/documentation/CoreML/MLFeatureValue/init(imageAtURL:pixelsWide:pixelsHigh:pixelFormatType:options:))

Creates a feature value that contains an image defined by an image URL and the image’s size and pixel format.

---

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)