https://github.com/calm/kenburns
A little Swift utility that performs the Ken Burns effect on an image
https://github.com/calm/kenburns
Last synced: about 1 year ago
JSON representation
A little Swift utility that performs the Ken Burns effect on an image
- Host: GitHub
- URL: https://github.com/calm/kenburns
- Owner: calm
- License: mit
- Created: 2016-07-01T21:21:57.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-11-06T23:01:16.000Z (almost 6 years ago)
- Last Synced: 2025-07-06T01:46:16.313Z (about 1 year ago)
- Language: Swift
- Homepage: http://calm.com/jobs
- Size: 52.1 MB
- Stars: 30
- Watchers: 27
- Forks: 18
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ken Burns
## Single Images

## Queue Images

A simple yet configurable Ken Burns effect. Use a single image or queue multiple images. The Kens Burns effect is a popular transition effect in film popularized by American documentarian Ken Burns. It creates the effect of motion using still imagery.
### Usage
`KenBurns` is written in Swift, use `KenBurnsImageView` from Swift or Objective-C. Examples are in Swift 3.0:
```swift
func newKenBurnsImageView(url: URL) -> KenBurnsImageView {
let ken = KenBurnsImageView()
ken.fetchImage(url: url, placeholder: UIImage(named: "placeholder"))
ken.startAnimating()
return ken
}
func stop(ken: KenBurnsImageView) {
ken.stopAnimating()
}
func pause(ken: KenBurnsImageView) {
ken.pause()
}
func resume(ken: KenBurnsImageView) {
ken.resume()
}
```
Initialize with `UIImage` or `URL`, and there are some paramaters you can set to configure the appearance:
```swift
func newKenBurnsImageView(image: UIImage) -> KenBurnsImageView {
let ken = KenBurnsImageView()
ken.setImage(image: image)
ken.zoomIntensity = 1.5
ken.setDuration(min: 5, max: 13)
ken.startAnimating()
return ken
}
```
Ken Burns has been powering [Calm](http://www.calm.com/ios)’s nature scenes and meditations since 2016. We found that adding this effect in place of a static image improves click-through rates (and users love it).
Due to unfortunate circumstances, Calm has no direct affiliation with [Ken Burns](https://en.wikipedia.org/wiki/Ken_Burns) himself 😞
### Demo
Launch and run
```
roadtrip.xcworkspace
```
To view demo
### Installation
KenBurns is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:
```ruby
pod "KenBurns"
```