whatisgithub

What is libpag?

tencent/libpag — explained in plain English

Analysis updated 2026-06-26

5,672C++Audience · developerComplexity · 3/5LicenseSetup · moderate

In one sentence

Tencent's library for playing After Effects animations as compact, editable PAG files inside iOS, Android, web, and desktop apps, used in WeChat and QQ, with runtime text and image swapping.

Mindmap

mindmap
  root((libpag))
    What it does
      Play AE animations
      Render PAG files
      Runtime editing
    Platforms
      iOS Android
      Web browser
      macOS Windows Linux
    Key benefits
      No video conversion
      Half the file size
      10x faster decoding
    Integration
      CocoaPods iOS
      Maven Android
      JS bundle web
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add high-quality After Effects animations to your iOS or Android app without converting them to video files

USE CASE 2

Swap text or images inside a running animation at runtime without modifying the original After Effects source

USE CASE 3

Reduce animation file sizes by switching from JSON-based formats like Lottie to the binary PAG format

USE CASE 4

Preview and check animation performance before handing files to developers using the PAGViewer desktop app

What is it built with?

C++JavaScriptCocoaPodsMavenCMake

How does it compare?

tencent/libpagffffffff0x/1earncnr-isti-vclab/meshlab
Stars5,6725,6705,675
LanguageC++C++C++
Setup difficultymoderateeasymoderate
Complexity3/51/53/5
Audiencedeveloperops devopsresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Precompiled binaries available for most platforms, building from source requires CMake, Ninja, and platform-specific compilers.

Use freely for any purpose including commercial use, as long as you keep the copyright notice (Apache 2.0).

So what is it?

libpag is a library from Tencent for playing back animations that were created in Adobe After Effects. Instead of converting animations to video files, designers export them as PAG files using a plugin, and libpag renders those files in real time inside an app. The result is a compact, scalable animation that can be modified at runtime, unlike a pre-rendered video. The PAG file format is designed to preserve all After Effects features, including effects from third-party plugins, vector shapes, and raster layers. The files are stored in a binary format that decodes about ten times faster than the JSON-based formats used by some other animation tools, and they tend to be roughly half the size for equivalent content. A desktop viewer app called PAGViewer lets designers preview their animations and check performance metrics before handing files off to developers. The library runs on iOS, Android, macOS, Windows, Linux, Harmony OS, and the web. Tencent uses it in its own major apps, including WeChat and QQ. Developers integrate it using standard package managers: CocoaPods for iOS, Maven for Android, OHPM for HarmonyOS, and a JavaScript bundle for web projects. Once integrated, the SDK provides APIs to swap out text or images inside an animation at runtime, combine multiple PAG files, and modify layer properties without redesigning the original After Effects file. Building the library from source requires a fairly involved toolchain including CMake, Ninja, and platform-specific compilers. Tencent publishes precompiled binaries for most platforms through their release page, so most developers will not need to build from source. The project is open source under the Apache 2.0 license. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Show me how to integrate libpag into an Android app using Maven and play a PAG animation file in a View
Prompt 2
Write Swift code using the libpag iOS SDK to load a PAG file and replace a text layer with custom content at runtime
Prompt 3
How do I add libpag to a web project and render a PAG animation inside an HTML canvas element?
Prompt 4
What After Effects effects and features does the PAG format support, and which ones does libpag not handle?
Prompt 5
How does libpag compare to Lottie in file size and playback performance for the same After Effects animation?

Frequently asked questions

What is libpag?

Tencent's library for playing After Effects animations as compact, editable PAG files inside iOS, Android, web, and desktop apps, used in WeChat and QQ, with runtime text and image swapping.

What language is libpag written in?

Mainly C++. The stack also includes C++, JavaScript, CocoaPods.

What license does libpag use?

Use freely for any purpose including commercial use, as long as you keep the copyright notice (Apache 2.0).

How hard is libpag to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is libpag for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.