XAnimatedImage is a performant animated GIF engine for iOS written in Swift based on FLAnimatedImage

Related tags

Image XAnimatedImage
Overview

XAnimatedImage: Performant animated GIF engine for iOS (FLAnimatedImage in Swift)

Platform

XAnimatedImage is a performant animated GIF engine for iOS written in Swift based on FLAnimatedImage. An illustration is shown below:

XAnimatedImage playing multiple GIFs

Features

  • Plays multiple GIFs simultaneously with a playback speed comparable to desktop browsers
  • Honors variable frame delays
  • Eliminates delays or blocking during the first playback loop
  • Interprets the frame delays of fast GIFs the same way modern browsers do

Who is this for?

  • Apps that don't support animated GIFs yet
  • Apps that already support animated GIFs but want a higher performance solution
  • People who want to tinker with the code (the corresponding blog post describing the original FLAnimatedImage repo is a great place to start; also see the To Do section below)

Requirements

  • iOS 7.1+
  • Xcode 7.1+

Installation

XAnimatedImage, like it's original counterpart FLAnimatedImage, is a well encapsulated drop-in component. Simply replace your UIImageView instances with instances of XAnimatedImageView to get animated GIF support. There is no central cache or state to manage.

Manually

You can integrate XAnimatedImage into your project manually. You can do it by copying the "Classes" folder in your project (make sure that "Create groups" option is selected).

Other

Other installation methods are currently being integrated into the project. Currently, this repository supports only manual installation. Planned, future installation methods will include:

  • CocoaPods
  • Carthage

##Usage

var animatedImage = XAnimatedImage(initWithAnimatedGIFData: NSData(contentsOfURL: NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("example", ofType: "gif")!))!)
var animatedImageView = XAnimatedImageView()
animatedImageView.animatedImage = animatedImage
animatedImageView.frame = CGRectMake(0,0,100,100)
self.view.addSubview(animatedImageView)

##To Do

  • Support other animated image formats such as APNG or WebP
  • Integration into network libraries and image caches
  • Investigate whether FLAnimatedImage should become a UIImage subclass
  • Smarter buffering
  • Investigate the usage of GPUImage for less CPU intensive image processing.
  • Support CocoaPods and Carthage for installation methods.

##Contributions

This project owes most in part to the original FLAnimatedImage contributors namely Raphael Schaad (github | @raphaelschaad).

If there any issues to be directed at me, you can reach me, Khaled Taha, @iamktothed.

You might also like...
DGImageView - Asynchronous image downloader with cache. Supports gif too

DGImageView Installation Usage DGImageView Asynchronous image downloader with cache. Supports gif, memory cache, disk cache features. Installation Xco

An app show your Live Photo and export as GIF.
An app show your Live Photo and export as GIF.

LivelyGIFs Show your Live Photo and export as GIF. Demo HighLights Do not use Pod or Cathage to install 3rd party library Simple logic, new learner fr

A tool support convert image gif to gif3d
A tool support convert image gif to gif3d

Trick convert gif to gif3d using Swift Features Simple way to convert gif to gif3d Change background Change size eraser tool How to work Add a layer w

Media view which subclasses UIImageView, and can display & load images, videos, GIFs, and audio and from the web, and has functionality to minimize from fullscreen, as well as show GIF previews for videos.
Media view which subclasses UIImageView, and can display & load images, videos, GIFs, and audio and from the web, and has functionality to minimize from fullscreen, as well as show GIF previews for videos.

I've built out the Swift version of this library! Screenshots Description ABMediaView can display images, videos, as well as now GIFs and Audio! It su

An early experimental general-purpose pattern matching engine for Swift.

Declarative String Processing for Swift An early experimental general-purpose pattern matching engine for Swift. See Declarative String Processing Ove

Animated sharingan loader for iOS projects.
Animated sharingan loader for iOS projects.

Animated sharingan loader for iOS projects. This is a fun project created using SwiftUI with love for the Uchiha clan. More types of eyes to come with tons of customizations...

Easy customizable avatar image asynchronously with progress bar animated
Easy customizable avatar image asynchronously with progress bar animated

JDSwiftAvatarProgress ##Objective-C JDAvatarProgress is available in Objective-C also, JDAvatarProgress Usage To run the example project, clone the re

GPU-based media processing library using Metal written in Swift
GPU-based media processing library using Metal written in Swift

GPU-based media processing library using Metal written in Swift. Overview MetalAcc is a GPU-Based media processing library that lets you apply GPU-acc

An open source iOS framework for GPU-based image and video processing
An open source iOS framework for GPU-based image and video processing

GPUImage Brad Larson http://www.sunsetlakesoftware.com @bradlarson [email protected] Overview The GPUImage framework is a BSD-licensed iO

Comments
  • Asynchronous issue.

    Asynchronous issue.

    There seem to be issues when trying to load gifs asynchronously. Most of the time it crashes because of nil values. It also seems to be the case when you swap out a gif for another one.

    bug 
    opened by phongleq 11
  • Added Carthage support

    Added Carthage support

    I know this was one feature that you wanted to supported. I wanted it as well so I took the liberty to add Carthage support. I had to do a bit of restructuring and rename the app to demo. So the framework would just stay XAnimatedImage

    opened by phongleq 2
  • App crashes when internet connections gets disconnected(Grabbing the NSURL from online)

    App crashes when internet connections gets disconnected(Grabbing the NSURL from online)

    I am using this animatedImage with a URL from online let urlString = "URLFROMINTERNET" let animatedImage = XAnimatedImage(initWithAnimatedGIFData: NSData(contentsOfURL: NSURL(string: urlString!)!)!)

    Everything is good, but if I was to put the app into aeroplane mode and scroll though the tableview where the animated image is displayed it will crash with the error fatal error: unexpectedly found nil while unwrapping an Optional value

    Any ideas how to stop this?

    bug 
    opened by Mattporter0 2
Owner
Khaled Taha
Khaled Taha
High performance GIF engine

SwiftyGif High performance & easy to use Gif engine Features UIImage and UIImageView extension based Remote GIFs with customizable loader Great CPU/Me

Alexis Creuzot 1.7k Jan 3, 2023
High-performance animated GIF support for iOS in Swift

Gifu adds protocol-based, performance-aware animated GIF support to UIKit. (It's also a prefecture in Japan). Install Swift Package Manager Add the fo

Reda Lemeden 2.6k Jun 21, 2021
Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients

Twitter Image Pipeline (a.k.a. TIP) Background The Twitter Image Pipeline is a streamlined framework for fetching and storing images in an application

Twitter 1.8k Dec 17, 2022
A simple, performant, and lightweight SVG parser

Key Features Parsing performance that meets or beats other popular SVG Frameworks A simple architecture, optimized for extension, flexibility and deve

Michael Choe 1.8k Dec 29, 2022
🚀SwiftUI Image downloader with performant LRU mem/disk cache.

Progressive concurrent image downloader for SwiftUI, with neat API and performant LRU mem/disk cache.

Cheng Zhang 42 Sep 24, 2022
A thread safe, performant, feature rich image fetcher

PINRemoteImage Fast, non-deadlocking parallel image downloader and cache for iOS PINRemoteImageManager is an image downloading, processing and caching

Pinterest 4k Jan 9, 2023
Patch out the GPU checks for any x86-64 macOS Unreal Engine-based game

UnrealGPUPatcher Download here Patch out the GPU checks for any x86-64 macOS Unreal Engine-based game, particularly ARK: Survival Evolved. Requirement

Jacob Greenfield 35 Jan 1, 2023
A Swift implementation of fastimage. Supports PNG, GIF, and JPEG.

ImageScout ImageScout is a Swift implementation of fastimage. It allows you to find the size and type of a remote image by downloading as little as po

Reda Lemeden 967 Dec 30, 2022
SwiftGif - A small UIImage extension with gif support.

SwiftGif - A small UIImage extension with gif support.

SwiftGif 1.3k Dec 20, 2022
Drop in GIF Collection View. Uses Tenor as default GIFs provider.

Drop in GIF Collection View. Uses Tenor as default GIFs provider. This will allow you to easily integrate GIF image search into your app or you can use this as a GIF keyboard for your messaging needs.

null 5 May 7, 2022