Tencent /libpag

The official rendering library for PAG (Portable Animated Graphics) files that renders After Effects animations natively across multiple platforms.

★ 5,822⑂ 533👁 47⑃ 1,525● 734▤ 73
HTMLNOASSERTIONCreated 2020-09-22pag.io
Download: v4.5.102v4.5.102 ↓4.5.1022026-11-08
+1
Daily
5,822
stars
533
forks
47
watchers
1,525
prs
734
issues
73
releases

README

English | 简体中文 | Homepage

 Introduction

libpag is a real-time rendering library for PAG (Portable Animated Graphics) files, capable of 
rendering both vector-based and raster-based animations across various platforms, including iOS, 
Android, OpenHarmony, macOS, Windows, Linux, and the Web.

PAG is an open-source file format designed for recording animations. You can create and export PAG 
files from Adobe After Effects using the PAGExporter plugin and preview them in the PAGViewer app, 
both available on macOS and Windows.

PAG is widely used in major Tencent apps like WeChat, Mobile QQ, Honor of Kings, Tencent Video, and 
QQ Music, as well as in thousands of third-party apps, reaching hundreds of millions of users.

 Advantages

- Highly efficient file format



Benefiting from its highly efficient binary format, PAG files decode 10 times faster than JSON files 
and are about 50% smaller in file size for the same animations. Designers can also easily include 
beautiful animations with bitmaps or audiovisual media in a single file without needing additional 
attachments.

- All AE features supported



While other solutions may only support exporting limited vector-based AE features, PAG combines 
vector-based and raster-based exporting techniques to support all AE animations in a single file. 
This means third-party plugin effects in AE can also be exported.

- Measurable performance



PAG provides a monitoring panel in PAGViewer that displays normalized performance data for PAG files,
making it easy for designers to review and optimize performance without needing developers. With 
numerous automatic optimization techniques from the PAGExporter plugin, you can create animations 
with impressive visual effects and excellent performance more efficiently.


PAGViewer includes a monitoring panel 
- Runtime editable animations



With the flexible editing APIs from the PAG SDK, developers can easily modify the layer structure of
a single PAG file, combine multiple PAG files into one composition, or replace text and images with 
all pre-designed animation effects applied at runtime. This significantly reduces the coding work 
required for features like video templates.

 System Requirements

- iOS 15.0+
- Android 5.0+
- HarmonyOS Next 5.0.0(12)+
- macOS 12.0+
- Windows 7.0+
- Chrome 69.0+ (Web)
- Safari 15.0+ (Web)

 Getting Started

We currently only publish precompiled libraries for iOS, Android, macOS, Web, and OpenHarmony. You 
can build libraries of other platforms from the source code. The latest releases can be downloaded
from here.

 iOS Integration

You can download the framework from the release page or add libpag to your project using CocoaPods.
To add the pod to your Podfile, include:


pod 'libpag'


And then run:


pod install


After installing the CocoaPod, import libpag into your project with:


import 


 Android Integration

You can download the AAR from the release page or add libpag to your project using Maven:

Edit the build

Top issues

Discussions

Latest release

v4.5.102 v4.5.102 2026-11-08
主要修改内容:

(1)修复鸿蒙平台 PAGView 事件分发器在 release 后写入已释放内存导致的卡死 (3761)

(2)更新 tgfx,合入 TaskPool 唤醒问题修复(鸿蒙)

(3)修复 Android 与鸿蒙平台 PAGImageView 设置 ScaleMode 为 None 后未恢复合成原始尺寸的问题 (3757)

(4)限制 ticker 驱动的异步刷新频率,并对解码失败的渲染增加冷却,避免循环播放时发热 (3793)

(5)解码失败时保留最后一帧已解码画面,不再显示透明帧 (3753)

(6)修复纹理替换图在图层缩小至低于 mipmap 阈值时渲染空白的问题 (3756)

(7)修复 HarfBuzz 构建下 RTL 及双向混排文本导致的 ANR 与字形映射错误 (3752)

(8)修复 pag 文件中引用环导致的栈溢出与死循环 (3747)

(9)更新 tgfx,修复视频边缘闪烁与 render target 创建时的空指针解引用

Main modifications:

(1) Fix OHOS main thread freezes caused by the PAGView event dispatcher writing to freed memory on release (3761)

(2) Update tgfx to

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON