---
title: "init(source:)"
framework: coreimage
role: symbol
role_heading: Initializer
path: "coreimage/cikernel/init(source:)"
---

# init(source:)

Creates a single kernel object.

## Declaration

```swift
convenience init?(source string: String)
```

## Parameters

- `string`: A program in the Core Image Kernel Language that contains a single routine marked using the kernel keyword.

## Return Value

Return Value A new kernel object. The class of the returned object can be CIKernel, CIColorKernel, or CIWarpKernel depending on the type of routine specified in the Core Image Kernel Language source code string.

## Discussion

Discussion The Core Image Kernel Language is a dialect of the OpenGL Shading Language. See Core Image Kernel Language Reference and Core Image Programming Guide for more details.

## See Also

### Related Documentation

- [Core Image Programming Guide](apple-archive/documentation/GraphicsImaging/Conceptual/CoreImaging/ci_intro.md)
- [Core Image Kernel Language Reference](apple-archive/documentation/GraphicsImaging/Reference/CIKernelLangRef/Introduction.md)

### Deprecated

- [makeKernels(source:)](coreimage/cikernel/makekernels(source:).md)
