---
title: lightTunnel()
framework: coreimage
role: symbol
role_heading: Type Method
path: coreimage/cifilter-swift.class/lighttunnel()
---

# lightTunnel()

Distorts an image by generating a light tunnel.

## Declaration

```swift
class func lightTunnel() -> any CIFilter & CILightTunnel
```

## Return Value

Return Value The distorted image.

## Discussion

Discussion This method applies the light tunnel filter to an image. This effect distorts the input image by warping the image to cylinder shape. The light tunnel filter uses the following properties: The following code creates a filter that generates a swirling pattern from the input image: func lightTunnel(inputImage: CIImage) -> CIImage {     let filter = CIFilter.lightTunnel()     filter.inputImage = inputImage     filter.radius = 100     filter.rotation = .pi     filter.center = CGPoint(         x: inputImage.extent.width / 2,         y: inputImage.extent.size.height / 2     )     return filter.outputImage!.cropped(to: inputImage.extent) }

## See Also

### Filters

- [bumpDistortion()](coreimage/cifilter-swift.class/bumpdistortion().md)
- [bumpDistortionLinear()](coreimage/cifilter-swift.class/bumpdistortionlinear().md)
- [circleSplashDistortion()](coreimage/cifilter-swift.class/circlesplashdistortion().md)
- [circularWrap()](coreimage/cifilter-swift.class/circularwrap().md)
- [displacementDistortion()](coreimage/cifilter-swift.class/displacementdistortion().md)
- [droste()](coreimage/cifilter-swift.class/droste().md)
- [glassDistortion()](coreimage/cifilter-swift.class/glassdistortion().md)
- [glassLozenge()](coreimage/cifilter-swift.class/glasslozenge().md)
- [holeDistortion()](coreimage/cifilter-swift.class/holedistortion().md)
- [ninePartStretched()](coreimage/cifilter-swift.class/ninepartstretched().md)
- [ninePartTiled()](coreimage/cifilter-swift.class/nineparttiled().md)
- [pinchDistortion()](coreimage/cifilter-swift.class/pinchdistortion().md)
- [stretchCrop()](coreimage/cifilter-swift.class/stretchcrop().md)
- [torusLensDistortion()](coreimage/cifilter-swift.class/toruslensdistortion().md)
- [twirlDistortion()](coreimage/cifilter-swift.class/twirldistortion().md)
