---
title: Applying visual effects to foreground subjects
framework: vision
role: sampleCode
role_heading: Sample Code
path: vision/applying-visual-effects-to-foreground-subjects
---

# Applying visual effects to foreground subjects

Segment the foreground subjects of an image and composite them to a new background with visual effects.

## Overview

Overview note: This sample code project is associated with WWDC23 session 10176: Lift subjects from images in your app. Configure the sample code project Before you run the sample code project in Xcode, set the run destination to an iOS 17 device.

## See Also

### Image background removal

- [VNInstanceMaskObservation](vision/vninstancemaskobservation.md)
- [VNGenerateForegroundInstanceMaskRequest](vision/vngenerateforegroundinstancemaskrequest.md)
- [VNGenerateForegroundInstanceMaskRequestRevision1](vision/vngenerateforegroundinstancemaskrequestrevision1.md)
