<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIFilter-swift.class/disintegrateWithMaskTransition()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image",
      "CoreImage"
    ],
    "preciseIdentifier" : "c:objc(cs)CIFilter(cm)disintegrateWithMaskTransitionFilter"
  },
  "title" : "disintegrateWithMaskTransition()"
}
-->

# disintegrateWithMaskTransition()

Transitions between two images using a mask image.

```
class func disintegrateWithMaskTransition() -> any CIFilter & CIDisintegrateWithMaskTransition
```

## Return Value

The transition image.

## Discussion

This method applies the disintegrate with mask transition filter to an image. The effect transitions from one image to another using the shapes defined by the mask image.

The disintegrate with mask transition filter uses the following properties:

- `inputImage`: The starting image with the type [`CIImage`](/documentation/CoreImage/CIImage).
- `targetImage`: The ending image with the type [`CIImage`](/documentation/CoreImage/CIImage).
- `maskImage`: An image with the type [`CIImage`](/documentation/CoreImage/CIImage).
- `time`: A `float` representing the parametric time of the transition from start (at time 0) to end (at time 1) as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `shadowRadius`: A `float` representing the size of the shadow as a <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `shadowDensity`: A `float` representing the strength of the shadow as a <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `shadowOffset`: A <doc://com.apple.documentation/documentation/CoreFoundation/CGPoint> representing the size of the shadow from the mask image.

The following code creates a filter that produces a transition between the input and target images starting in the area’s outline in the mask image:

```swift
func disintergrate(inputImage: CIImage, targetImage: CIImage, maskImage: CIImage) -> CIImage {
    let disintergrateTransition  = CIFilter.disintegrateWithMaskTransition()
    disintergrateTransition.inputImage = inputImage
    disintergrateTransition.targetImage = targetImage
    disintergrateTransition.maskImage = maskImage
    disintergrateTransition.time = 0.5
    disintergrateTransition.shadowRadius = 8
    disintergrateTransition.shadowDensity = 0.65
    disintergrateTransition.shadowOffset = CGPoint(x: 0, y: -1)
    return disintergrateTransition.outputImage!
}
```

![Three photographs. In the photo on the left, there are multiple small purple flowers photographed close up with good lighting, and the background has a slight blur. In the photograph on the right is a tall building with two trees directly in front of the building. In the center photo, a disintegrate with mask transition filter is applied, resulting in a still photograph of the moving transition. The left photograph is overlaid on the right photo while slowly transitioning to the city image, with a slow fade of the flower image to the city image with added brightness.](images/com.apple.coreimage/media-3616430@2x.png)

---

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)