Skip to content

chuganzy/HCImage-BPG

Repository files navigation

Build Status codecov CocoaPods Carthage Platform

HCImage+BPG

BPG (http://bellard.org/bpg/) decoder for iOS and macOS.

Features

  • Supports macOS
  • Supports iOS
  • Supports animation
  • Supports nullability

Usage

iOS

  • Objective-C
NSData *data = ...;
UIImage *image = [UIImage imageWithBPGData:data];
  • Swift
let data: NSData = ...
let image: UIImage? = UIImage(BPGData: data)

macOS

  • Objective-C
NSData *data = ...;
NSImage *image = [NSImage imageWithBPGData:data];
  • Swift
let data: NSData = ...
let image: NSImage? = NSImage(BPGData: data)

Installation

CocoaPods

pod 'HCImage+BPG'

Carthage

github "chuganzy/HCImage-BPG"

License

MIT.

libbpg

https://github.com/thomas-huet/libbpg

libbpg and bpgenc are released under the LGPL license (the FFmpeg part is under the LGPL, the BPG specific part is released under the BSD license).

BPG relies on the HEVC compression technology which may be protected by patents in some countries. Most devices already include or will include hardware HEVC support, so we suggest to use it if patents are an issue.