<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ARKit",
  "identifier" : "/documentation/ARKit/ARMatteGenerator",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "ARKit"
    ],
    "preciseIdentifier" : "c:objc(cs)ARMatteGenerator"
  },
  "title" : "ARMatteGenerator"
}
-->

# ARMatteGenerator

An object that creates matte textures you use to occlude your app’s virtual content with people, that ARKit recognizes in the camera feed.

```
class ARMatteGenerator
```

## Overview

Use this class when you want full control over occluding your app’s virtual content, based on people ARKit recognizes in the camera feed.

> Note:
> Apps using one of the standard renderers  (`ARView` or ``doc://com.apple.arkit/documentation/ARKit/ARSCNView``) don’t need this class to effect people occlusion. See ``doc://com.apple.arkit/documentation/ARKit/ARConfiguration/frameSemantics-swift.property`` for more information.

To assist your custom renderer with people occlusion, matte generator processes alpha and depth information in a frame’s [`segmentationBuffer`](/documentation/ARKit/ARFrame/segmentationBuffer) and [`estimatedDepthData`](/documentation/ARKit/ARFrame/estimatedDepthData) to provide you with matte and depth textures. You use these textures to layer people on top of your app’s virtual content.

## Topics

### Creating a Matte Generator

[`-  initWithDevice:matteResolution:`](/documentation/ARKit/ARMatteGenerator/init(device:matteResolution:))

Creates an AR matte generator.

### Creating an Alpha Matte Texture

[`-  generateMatteFromFrame:commandBuffer:`](/documentation/ARKit/ARMatteGenerator/generateMatte(from:commandBuffer:))

Generates alpha matte at either full resolution or half the resolution of the captured image.

### Creating a Depth Texture

[`-  generateDilatedDepthFromFrame:commandBuffer:`](/documentation/ARKit/ARMatteGenerator/generateDilatedDepth(from:commandBuffer:))

Generates dilated depth at the resolution of the segmentation stencil.

### Controlling Resolution

[`Resolution`](/documentation/ARKit/ARMatteGenerator/Resolution)

A resolution for a matte texture.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)