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

# glassLozenge()

Creates a lozenge-shaped lens and distorts the image.

```
class func glassLozenge() -> any CIFilter & CIGlassLozenge
```

## Return Value

The distorted image.

## Discussion

This method applies the glass lozenge filter to an image. This effect distorts an image by creating a lozenge shape placed over the input image.

The absolute threshold filter uses the following properties:

- `inputImage`: An image with the type [`CIImage`](/documentation/CoreImage/CIImage).
- `radius`: A `float` representing the radius of the lozenge distortion as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `refraction`: A `float` representing the refraction of the glass as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `inputPoint1`: A <doc://com.apple.documentation/documentation/CoreFoundation/CGPoint> representing the x and y positions that define the center of the circle at the first end of the lozenge.
- `inputPoint2`: A <doc://com.apple.documentation/documentation/CoreFoundation/CGPoint> representing the x and y positions that define the center of the circle at the second end of the lozenge.

The following code creates a filter that results in a large glass lozenge distorting the image:

```swift
func glassLozenge(inputImage: CIImage) -> CIImage {
    let filter = CIFilter.glassLozenge()
    filter.inputImage = inputImage
    filter.refraction = 1.7
    filter.point0 = CGPoint(x: 150, y: 1050)
    filter.point1 = CGPoint(x: 3050, y: 150)
    return filter.outputImage!
}
```

![Two images next to each other. The left image contains a photograph of three hydrangea flowers with leaves in the background. In the right image, the glass lozenge filter has been applied. It appears as if the glass pill shape has been placed on top of the image.](images/com.apple.coreimage/media-4407280@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)