<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CISampler/initWithImage:keysAndValues:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CISampler(im)initWithImage:keysAndValues:"
  },
  "title" : "initWithImage:keysAndValues:"
}
-->

# initWithImage:keysAndValues:

Initializes the sampler with an image object using options specified as key-value pairs.

```
- (instancetype) initWithImage:(CIImage *) im keysAndValues:(id) key0;
```

## Parameters

`im`

The image object to initialize the sampler with.

`key0`

A list of key-value pairs that represent options.  Each key needs to be followed by that appropriate value. You can supply one or more key-value pairs. Use `nil` to specify the end of the key-value options. See [Sampler Option Keys](/documentation/CoreImage/sampler-option-keys).

---

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)