<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CISampler"
  },
  "title" : "CISampler"
}
-->

# CISampler

An object that retrieves pixel samples for processing by a filter kernel.

```
class CISampler
```

## Overview

The `CISampler` class retrieves samples of images for processing by a [`CIKernel`](/documentation/CoreImage/CIKernel) object. A `CISampler` object defines a coordinate transform, and modes for interpolation and wrapping. You use `CISampler` objects in conjunction with other Core Image classes, such as  [`CIFilter`](/documentation/CoreImage/CIFilter-swift.class), `CIKernel`, and [`CIFilterShape`](/documentation/CoreImage/CIFilterShape), to create custom filters.

## Topics

### Creating a Sampler

[`samplerWithImage:`](/documentation/CoreImage/CISampler/samplerWithImage:)

Creates and returns a sampler that references an image.

[`samplerWithImage:keysAndValues:`](/documentation/CoreImage/CISampler/samplerWithImage:keysAndValues:)

Creates and returns a sampler that references an image using options specified as key-value pairs.

[`samplerWithImage:options:`](/documentation/CoreImage/CISampler/samplerWithImage:options:)

Creates and returns a sampler that references an image using options specified in a dictionary.

### Initializing a Sampler

[`init(image:)`](/documentation/CoreImage/CISampler/init(image:))

Initializes a sampler with an image object.

[`initWithImage:keysAndValues:`](/documentation/CoreImage/CISampler/initWithImage:keysAndValues:)

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

[`init(image:options:)`](/documentation/CoreImage/CISampler/init(image:options:))

Initializes the sampler with an image object using options specified in a dictionary.

### Getting Information About the Sampler Object

[`definition`](/documentation/CoreImage/CISampler/definition)

The domain of definition (DOD) of the sampler

[`extent`](/documentation/CoreImage/CISampler/extent)

The rectangle that specifies the extent of the sampler

### Constants

[Sampler Option Keys](/documentation/CoreImage/sampler-option-keys)

Keys for creating a sampler.

[Sampler Option Values](/documentation/CoreImage/sampler-option-values)

Values for 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)