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

# init(imageAtURL:constraint:options:)

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

```
convenience init(imageAtURL url: URL, constraint: MLImageConstraint, options: [MLFeatureValue.ImageOption : Any]? = nil) throws
```

## Parameters

`url`

A <doc://com.apple.documentation/documentation/Foundation/URL> (Swift) or <doc://com.apple.documentation/documentation/Foundation/NSURL> (Objective-C) to an image.

`constraint`

An [`MLImageConstraint`](/documentation/CoreML/MLImageConstraint) instance.

`options`

A dictionary of <doc://com.apple.documentation/documentation/Vision/VNImageCropAndScaleOption> values, each keyed by [`MLFeatureValue.ImageOption`](/documentation/CoreML/MLFeatureValue/ImageOption).

## Discussion

---

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)