DFImageManager alternatives and similar libraries
Based on the "Image" category.
Alternatively, view DFImageManager alternatives based on common mentions on social networks and blogs.
-
SDWebImage
Asynchronous image downloader with cache support as a UIImageView category -
GPU Image
An open source iOS framework for GPU-based image and video processing -
Kingfisher
A lightweight, pure-Swift library for downloading and caching images from the web. -
MWPhotoBrowser
A simple iOS photo and video browser with grid view, captions and selections. -
FastImageCache
iOS library for quickly displaying images while scrolling -
TOCropViewController
A view controller for iOS that allows users to crop portions of UIImage objects -
GPUImage2
GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing. -
PINRemoteImage
A thread safe, performant, feature rich image fetcher -
AlamofireImage
AlamofireImage is an image component library for Alamofire -
IDMPhotoBrowser
Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more -
NYTPhotoViewer
A modern photo viewing experience for iOS. -
UIImageColors
Fetches the most dominant and prominent colors from an image. -
SKPhotoBrowser
Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift -
AspectFillFaceAware
An extension that gives UIImageView the ability to focus on faces within an image. -
RSKImageCropper
An image cropper / photo cropper for iOS like in the Contacts app with support for landscape orientation. -
GPUImage3
GPUImage 3 is a BSD-licensed Swift framework for GPU-accelerated video and image processing using Metal. -
TLPhotoPicker
📷 multiple phassets picker for iOS lib. like a facebook -
ImageSlideshow
Swift image slideshow with circular scrolling, timer and full screen viewer -
EBPhotoPages
A photo gallery for iOS with a modern feature set. Similar features as the Facebook photo browser. -
Lightbox
:milky_way: A convenient and easy to use image viewer for your iOS app -
TinyCrayon
A smart and easy-to-use image masking and cutout SDK for mobile apps. -
MetalPetal
A GPU accelerated image and video processing framework built on Metal. -
Twitter Image Pipline
Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients -
ImagePickerSheetController
ImagePickerSheetController replicates the custom photo action sheet in iMessage. -
Sharaku
(Not maintained)Image filtering UI library like Instagram. -
YUCIHighPassSkinSmoothing
An implementation of High Pass Skin Smoothing using Apple's Core Image Framework -
SFSafeSymbols
Safely access Apple's SF Symbols using static typing -
CTPanoramaView
A library that displays spherical or cylindrical panoramas with touch or motion based controls. -
ImageScout
A Swift implementation of fastimage. Supports PNG, GIF, and JPEG. -
Paparazzo
Custom iOS camera and photo picker with editing capabilities -
ShadowImageView
A apple music cover picture shadow style image library -
OnlyPictures
A simple and flexible way to add source of overlapping circular pictures, currently supports horizontal overlapping or distant pictures with great layout flexibility. -
AXPhotoViewer
An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos. -
ComplimentaryGradientView
Create complementary gradients generated from dominant and prominent colors in supplied image. Inspired by Grade.js -
Imaginary
:unicorn: Remote images, as easy as one, two, three. -
SimpleImageViewer
A snappy image viewer with zoom and interactive dismissal transition. -
SABlurImageView
You can use blur effect and it's animation easily to call only two methods. -
Viewer
Image viewer (or Lightbox) with support for local and remote videos and images
Appwrite - The Open Source Firebase alternative introduces iOS support
* 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 DFImageManager or a related project?
README
Advanced framework for loading, caching, processing, displaying and preheating images.
This framework is no longer maintained.
Programming in Swift? Check out Nuke!
Features
- Zero config
- Works great with both Objective-C and Swift
- Performant, asynchronous, thread safe
Loading
- Uses NSURLSession with HTTP/2 support
- Optional AFNetworking integration, combine the power of both frameworks!
- Uses a single fetch operation for equivalent requests
- Intelligent preheating of images close to the viewport
Caching
- Doesn't reinvent caching, relies on HTTP cache and its implementation in Foundation
- Caching is completely transparent to the client
- Two cache layers, including top level memory cache for decompressed images
Processing
- Optional FLAnimatedImage integration
- Optional WebP integration
- Progressive image decoding including progressive JPEG
- Background image decompression and scaling in a single step
- Resize and crop loaded images to fit displayed size, add rounded corners or circle
Advanced
- Customize different parts of the framework using dependency injection
- Create and compose image managers into a tree of responsibility
Getting Started
- Take a look at comprehensive demo using
pod try DFImageManager
command - Check out complete documentation and Wiki
- Install,
@import DFImageManager
and enjoy!
Usage
Zero Config
[[DFImageManager imageTaskForResource:<#imageURL#> completion:^(UIImage *image, NSError *error, DFImageResponse *response, DFImageTask *task){
// Use loaded image
}] resume];
Adding Request Options
DFMutableImageRequestOptions *options = [DFMutableImageRequestOptions new]; // builder
options.priority = DFImageRequestPriorityHigh;
options.allowsClipping = YES;
DFImageRequest *request = [DFImageRequest requestWithResource:<#imageURL#> targetSize:CGSizeMake(100, 100) contentMode:DFImageContentModeAspectFill options:options.options];
[[DFImageManager imageTaskForRequest:request completion:^(UIImage *image, NSError *error, DFImageResponse *response, DFImageTask *imageTask) {
// Image is resized and clipped to fill 100x100px square
if (response.isFastResponse) {
// Image was returned synchronously from the memory cache
}
}] resume];
Using Image Task
DFImageTask *task = [DFImageManager imageTaskForResource:<#imageURL#> completion:nil];
NSProgress *progress = task.progress;
task.priority = DFImageRequestPriorityHigh; // Change priority of executing task
[task cancel];
Using UI Components
Use methods from UIImageView
category for simple cases:
UIImageView *imageView = ...;
[imageView df_setImageWithResource:<#imageURL#>];
Use DFImageView
for more advanced features:
DFImageView *imageView = ...;
imageView.allowsAnimations = YES; // Animates images when the response wasn't fast enough
imageView.managesRequestPriorities = YES; // Automatically changes current request priority when image view gets added/removed from the window
[imageView prepareForReuse];
[imageView setImageWithResource:<#imageURL#>];
UICollectionView
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *cell = <#cell#>
DFImageView *imageView = (id)[cell viewWithTag:15];
if (!imageView) {
imageView = [[DFImageView alloc] initWithFrame:cell.bounds];
imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
imageView.tag = 15;
[cell addSubview:imageView];
}
[imageView prepareForReuse];
[imageView setImageWithResource:<#image_url#>];
return cell;
}
Cancel image task as soon as the cell goes offscreen (optional):
- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
[((DFImageView *)[cell viewWithTag:15]) prepareForReuse];
}
Preheating Images
NSArray<DFImageRequest *> *requestsForAddedItems = <#requests#>;
[DFImageManager startPreheatingImagesForRequests:requestsForAddedItems];
NSArray<DFImageRequest *> *requestsForRemovedItems = <#requests#>;
[DFImageManager stopPreheatingImagesForRequests:requestsForRemovedItems];
Progressive Image Decoding
// Enable progressive image decoding
[DFImageManagerConfiguration setAllowsProgressiveImage:YES];
// Create image request that allows progressive image
DFMutableImageRequestOptions *options = [DFMutableImageRequestOptions new];
options.allowsProgressiveImage = YES;
DFImageRequest *request = <#request#>;
DFImageTask *task = <#task#>;
task.progressiveImageHandler = ^(UIImage *__nonnull image){
imageView.image = image;
};
[task resume];
Customizing Image Manager
id<DFImageFetching> fetcher = <#fetcher#>;
id<DFImageDecoding> decoder = <#decoder#>;
id<DFImageProcessing> processor = <#processor#>;
id<DFImageCaching> cache = <#cache#>;
DFImageManagerConfiguration *configuration = [[DFImageManagerConfiguration alloc] initWithFetcher:fetcher];
configuration.decoder = decoder;
configuration.processor = processor;
configuration.cache = cache;
[DFImageManager setSharedManager:[[DFImageManager alloc] initWithConfiguration:configuration]];
Composing Image Managers
The DFCompositeImageManager
constructs a tree of responsibility from image managers and dynamically dispatch requests between them. Each manager should conform to DFImageManaging
protocol. The DFCompositeImageManager
also conforms to DFImageManaging
protocol so that individual managers and compositions can be treated uniformly.
id<DFImageManaging> manager1 = <#manager#>
id<DFImageManaging> manager2 = <#manager#>
id<DFImageManaging> composite = [[DFCompositeImageManager alloc] initWithImageManagers:@[manager1, manager2]];
Design
Protocol | Description |
---|---|
DFImageManaging |
A high-level API for loading images |
DFImageFetching |
Performs fetching of image data (NSData ) |
DFImageDecoding |
Converts NSData to UIImage objects |
DFImageProcessing |
Processes decoded images |
DFImageCaching |
Stores processed images into memory cache |
Installation
CocoaPods
To install DFImageManager add a dependency in your Podfile:
pod 'DFImageManager'
By default it will install these subspecs:
DFImageManager/Core
- DFImageManager core classesDFImageManager/UI
- UI components
There are four more optional subspecs:
DFImageManager/AFNetworking
- replaces networking stack with AFNetworkingDFImageManager/GIF
- GIF support with a FLAnimatedImage dependencyDFImageManager/WebP
- WebP support with a libwebp dependencyDFImageManager/PhotosKit
- Photos Framework support
To install optional subspecs include them in your Podfile:
pod 'DFImageManager'
pod 'DFImageManager/AFNetworking'
pod 'DFImageManager/GIF'
pod 'DFImageManager/WebP'
pod 'DFImageManager/PhotosKit'
Carthage
DFImageManager has a limited Carthage support that doesn't feature FLAnimatedImage and AFNetworking integration. To install DFImageManager add a dependency to your Cartfile:
github "kean/DFImageManager"
Requirements
- iOS 8.0+ / watchOS 2
- Xcode 7.0+
Supported Image Formats
- Image formats supported by
UIImage
(JPEG, PNG, BMP, and more) - GIF (
GIF
subspec) - WebP (
WebP
subspec)
Contribution
- If you need help, use Stack Overflow. (Tag 'dfimagemanager')
- If you found a bug, and can provide steps to reproduce it, open an issue.
- If you have a feature request, open an issue.
- If you want to contribute, branch of the
develop
branch and submit a pull request.
Contacts
License
DFImageManager is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the DFImageManager README section above
are relevant to that project's source code only.