---
title: "init(onePieceImage:twoPieceImageBackground:twoPieceImageForeground:)"
framework: clockkit
role: symbol
role_heading: Initializer
path: "clockkit/clkimageprovider/init(onepieceimage:twopieceimagebackground:twopieceimageforeground:)"
---

# init(onePieceImage:twoPieceImageBackground:twoPieceImageForeground:)

Creates and returns an image provider with both one-piece and two-piece images.

## Declaration

```swift
convenience init(onePieceImage: UIImage, twoPieceImageBackground: UIImage?, twoPieceImageForeground: UIImage?)
```

## Parameters

- `onePieceImage`: The one-piece image to use. The image must be a template image, where only the alpha channel is used to define the image contents. This parameter must not be nil.
- `twoPieceImageBackground`: The background to use for a two-piece image. The image must be a template image, where only the alpha channel is used to define the image contents. This parameter must not be nil.
- `twoPieceImageForeground`: The foreground to use for a two-piece image. The image must be a template image, where only the alpha channel is used to define the image contents. This parameter must not be nil.

## Return Value

Return Value An image provider with both the one-piece and two-piece images.

## Discussion

Discussion Use this method when you want to display a two-piece image in multicolor environments. In monochrome environments, the image provider still displays the one-piece image. After creating the image provider, you can customize the tint color applied to your images by modifying the tintColor property.

## See Also

### Creating an Image Provider

- [init(onePieceImage:)](clockkit/clkimageprovider/init(onepieceimage:).md)
