YapImageManager alternatives and similar libraries
Based on the "Images" category.
Alternatively, view YapImageManager alternatives based on common mentions on social networks and blogs.
-
SwiftGen-Assets
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs! -
GPUImage 2
GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing. -
SkyFloatingLabelTextField
A beautiful and flexible text field control implementation of "Float Label Pattern". Written in Swift. -
GPUImage 3
GPUImage 3 is a BSD-licensed Swift framework for GPU-accelerated video and image processing using Metal. -
Brightroom
DISCONTINUED. 📷 A composable image editor using Core Image and Metal. [Moved to: https://github.com/FluidGroup/Brightroom] -
CTPanoramaView
A library that displays spherical or cylindrical panoramas with touch or motion based controls. -
FMPhotoPicker
A modern, simple and zero-dependency photo picker with an elegant and customizable image editor -
AXPhotoViewer
An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos. -
PassportScanner
Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer. -
Harbeth
🎨 GPU accelerated image / video and camera filter library based on Metal. Support macOS & iOS. 图像、视频、相机滤镜框架 -
JLStickerTextView
add text(multiple line support) to imageView, edit, rotate or resize them as you want, then render the text on image -
XAnimatedImage
XAnimatedImage is a performant animated GIF engine for iOS written in Swift based on FLAnimatedImage -
UIImageView-BetterFace-Swift
DISCONTINUED. autoresize images and if any face discovered refine the position of the image. -
SwiftDraw
Swift library and command line tool to convert SVGs into SFSymbol, PNG, PDF and Swift source code. -
KFSwiftImageLoader
An extremely high-performance, lightweight, and energy-efficient pure Swift async web image loader with memory and disk caching for iOS and Watch. -
MCScratchImageView
A custom ImageView that is used to cover the surface of other view like a scratch card, user can swipe the mulch to see the view below. -
DTPhotoViewerController
A fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer. -
FacebookImagePicker
DISCONTINUED. FacebookImagePicker is Facebook album photo picker written in Swift.
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of YapImageManager or a related project?
README
[YapImageManagerLogo](Docs/header.gif)
Features
- [x] Asynchronous image downloader with priority queuing
- [x] Advanced memory and database caching using YapDatabase (SQLite)
- [x] Guarantee of only one image download per request
- [x] Cancellation of pending requests with ticket
- [x] Background image decoding, resizing and filtering
- [x] Custom image filters
- [x] Image rendering of gradients and more using filters
- [x] High performance scrolling
- [x] Automatic pause and resume of download queue on reachability changes
- [x] Written completely in Swift
Roadmap Features
- [x] Ability to capture image height and width from the raw decoded image data stream, before the image is downloaded via a notification, for gif, png, and jpeg formats. This is extrememly useful for displaying full width images with the proper aspect ratio in a table view or collection view, by enabling you to calculate the cell height and update the layout almost immediately while the visible images are downloading.
- [x] Ability to return an image with the first frame of a GIF before the entire GIF is downloaded.
- [x] Ability to convert GIFs to MP4 files for better memory managment and scrolling performance
Requirements
- iOS 10.0+ / tvOS 9.0+
- Xcode 8.0+
- Swift 3.0+
Installation
CocoaPods
YapImageManager supports CocoaPods for easy installation. Below is a sample podfile.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'YapImageManager', '~> 1.0.2'
end
Usage
Requesting a full-sized image
Below is an example of how to request a full-sized, decoded image and set the image response on a UIImageView
.
YapImageManager.sharedInstance.asyncImage(forURLString: URLString) { [weak self] response in
if let image = response.image {
self?.imageView.image = image
}
}
Requesting an image of a specific maximum size
Below is an example of how to fetch a decoded image of a specific size and set the image response on a UIImageView
. Requesting an image size that matches the bounds of your UIImageView
can increase scrolling performance but avoiding a resize on the GPU. Decoded and sized images are cached in memory, reducing CPU time.
YapImageManager.sharedInstance.asyncImage(forURLString: URLString, size: self.bounds.size) { [weak self] response in
if let image = response.image {
self?.imageView.image = image
}
}
Requesting an image with a ticket for cancellation
Requesting an image with a ticket is important for use in a UITableView
or UICollectionView
with recycling cells. When a cell is recycled, cancelling the ticket ensures that a prior image request will not complete and update the image of a new cell with a different image request. It also will improve performance by cancelling any unneeded download requests for cells that are no longer visible during fast scrolling. Below is an example.
Add the ticket
member variable to your class...
private var ticket: ImageRequestTicket?
Request the image, saving the ticket...
ticket = YapImageManager.sharedInstance.asyncImage(forURLString: URLString, size: self.bounds.size) { [weak self] response in
if response.ticket == self?.ticket {
self?.ticket = nil
if let image = response.image {
self?.imageView.image = image
}
}
}
In prepareForReuse
, cancel the ticket...
override func prepareForReuse() {
super.prepareForReuse()
if let ticket = self.ticket {
YapImageManager.sharedInstance.cancelImageRequest(forTicket: ticket)
self.ticket = nil
}
}
Below is the example output.
[Sized Images](Docs/exampleSized.png)
Requesting an image with filters
To render an image with one or more image filters, simply pass an array of YapImageFilter
in the request. YapImageManager has the following built-in filters:
YapAspectFillFilter
- draws the original image with content mode aspect fillYapGradientFilter
- draws a gradient from a specifiedstartColor
toendColor
YapColorFilter
- draws a background color, or overlay color, depending on whether you include before or afterYapAspectFillFilter
YapOverlayImageFilter
- draws a customUIImage
specified byoverlayImage
You can create your own custom filters by adopting the protocol YapImageFilter
.
Below is an example of adding a gradient overlay to an image. When using filters, be sure at least one filter renders the original image, for example using YapAspectFillFilter
.
let filters: [YapImageFilter] = [YapAspectFillFilter(), YapGradientFilter(startColor: UIColor.black.withAlphaComponent(0.5), endColor: .clear)]
YapImageManager.sharedInstance.asyncImage(forURLString: URLString, size: self.bounds.size, filters: filters) { [weak self] response in
if let image = response.image {
self?.imageView.image = image
}
}
Below is the example output.
[Sized Images with Gradient](Docs/exampleSizedWithGradient.png)
To render a new image, for example a gradient
To render a new image using filters, use the createImage
method passing in the desired size and an array of YapImageFilter
. The following example generates a simple overlay gradient.
let red = UIColor(red: 0.93, green:0.09, blue:0.31, alpha:1.0)
let gradient = YapGradientFilter(startColor: red, endColor: .clear)
YapImageManager.sharedInstance.createImage(withSize: self.bounds.size, filters: [gradient]) { [weak self] image in
self?.imageView.image = image
}
Below is the example output.
[Gradient Images](Docs/exampleGradient.png)
Credits
YapImageManager is owned and maintained by Yap Studios.