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

Related tags

GIF 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...
Captcha implementation in ios App

CaptchaDemo_ios A Swift project to showcase implementation of Google ReCaptcha in iOS Application. Features A light weight basic wrapper to handle com

iOS implementation of the Catrobat language

Catty Catty, also known as Pocket Code for iOS, is an on-device visual programming system for iPhones. Catrobat is a visual programming language and s

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

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

Performant animated GIF engine for iOS
Performant animated GIF engine for iOS

FLAnimatedImage is a performant animated GIF engine for iOS: Plays multiple GIFs simultaneously with a playback speed comparable to desktop browsers H

An animated gif & apng engine for iOS in Swift. Have a great performance on memory and cpu usage.

Features Small but complete, only200lines of code. Allow to control display quality, memory usage, loop time and display progress. Have a great perfor

Async GIF image decoder and Image viewer supporting play GIF images. It just use very less memory.
Async GIF image decoder and Image viewer supporting play GIF images. It just use very less memory.

YLGIFImage Asynchronized GIF image class and Image viewer supporting play/stop GIF images. It just use very less memory. Following GIF usually will co

 Palico Engine: Metal-Based Game Engine in Swift 🐑
Palico Engine: Metal-Based Game Engine in Swift 🐑

Palico Engine: Metal-Based Game Engine in Swift 🐑 Implement a game engine on macOS using Metal API. Still in development. Currently I am working on a

Gifu adds protocol-based, performance-aware animated GIF support to UIKit.
Gifu adds protocol-based, performance-aware animated GIF support to UIKit.

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

High performance GIF engine
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

 SwiftyGif - High performance & easy to use Gif engine
SwiftyGif - High performance & easy to use Gif engine

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

High-performance animated GIF support for iOS in Swift
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

High-performance animated GIF support for iOS in Swift
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

Complete Animated GIF Support for iOS, with Functions, NSJSONSerialization-style Class, and (Optional) UIImage Swizzling
Complete Animated GIF Support for iOS, with Functions, NSJSONSerialization-style Class, and (Optional) UIImage Swizzling

AnimatedGIFImageSerialization This library is no longer maintained. In iOS 13+ and macOS 10.15+, use CGAnimateImageAtURLWithBlock instead. AnimatedGIF

Image framework for iOS to display/encode/decode animated WebP, APNG, GIF, and more.
Image framework for iOS to display/encode/decode animated WebP, APNG, GIF, and more.

YYImage Image framework for iOS to display/encode/decode animated WebP, APNG, GIF, and more. (It's a component of YYKit) Features Display/encode/decod

Imagine Engine - a fast, high performance Swift 2D game engine for Apple's platforms
Imagine Engine - a fast, high performance Swift 2D game engine for Apple's platforms

Welcome to Imagine Engine, an ongoing project that aims to create a fast, high performance Swift 2D game engine for Apple's platforms that is also a j

CleanroomLogger provides an extensible Swift-based logging API that is simple, lightweight and performant
CleanroomLogger provides an extensible Swift-based logging API that is simple, lightweight and performant

CleanroomLogger CleanroomLogger provides an extensible Swift-based logging API that is simple, lightweight and performant. The API provided by Cleanro

Add PullToRefresh using animated GIF to any scrollView with just simple code
Add PullToRefresh using animated GIF to any scrollView with just simple code

UzysAnimatedGifPullToRefresh Add PullToRefresh using animated GIF to any scrollView with just simple code UzysAnimatedGifPullToRefresh features: simpl

A declarative, performant, iOS calendar UI component that supports use cases ranging from simple date pickers all the way up to fully-featured calendar apps.
A declarative, performant, iOS calendar UI component that supports use cases ranging from simple date pickers all the way up to fully-featured calendar apps.

HorizonCalendar A declarative, performant, calendar UI component that supports use cases ranging from simple date pickers all the way up to fully-feat

Twitter Logging Service is a robust and performant logging framework for iOS clients

Twitter Logging Service Background Twitter created a framework for logging in order to fulfill the following requirements: fast (no blocking the main

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
An animated gif & apng engine for iOS in Swift. Have a great performance on memory and cpu usage.

Features Small but complete, only200lines of code. Allow to control display quality, memory usage, loop time and display progress. Have a great perfor

Jiawei Wang 1k Nov 9, 2022
Async GIF image decoder and Image viewer supporting play GIF images. It just use very less memory.

YLGIFImage Asynchronized GIF image class and Image viewer supporting play/stop GIF images. It just use very less memory. Following GIF usually will co

Yong Li 1.8k Aug 15, 2022
SwiftyGif - High performance & easy to use 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.8k Jan 4, 2023
Complete Animated GIF Support for iOS, with Functions, NSJSONSerialization-style Class, and (Optional) UIImage Swizzling

AnimatedGIFImageSerialization This library is no longer maintained. In iOS 13+ and macOS 10.15+, use CGAnimateImageAtURLWithBlock instead. AnimatedGIF

Mattt 1.1k Sep 29, 2022
Image framework for iOS to display/encode/decode animated WebP, APNG, GIF, and more.

YYImage Image framework for iOS to display/encode/decode animated WebP, APNG, GIF, and more. (It's a component of YYKit) Features Display/encode/decod

null 1.7k Dec 9, 2022
🌠 A small UIImage extension with gif support

?? A small UIImage extension with gif support

SwiftGif 1.3k Dec 20, 2022
Convert live photos and videos into animated GIFs in iOS, or extract frames from them.

Create a GIF from the provided video file url, Or extract images from videos. This repository has been separated from original repo along with some no

gitmerge 83 May 18, 2022
Test2 - A curated list of Open Source example iOS apps developed in Swift

Example iOS Apps A curated list of Open Source example iOS apps developed in Swi

null 0 Jan 4, 2022
High performance and delightful way to play with APNG format in iOS.

APNGKit is a high performance framework for loading and displaying APNG images in iOS and macOS. It's built with high-level abstractions and brings a

Wei Wang 2.1k Jan 2, 2023