HubLensCross-platformTencent/libpag
// archived 2026-04-27
Tencent

libpag

Mobile#Animation#Rendering#Cross-platform#Graphics#SDK
View on GitHub
5,664

// summary

libpag is a powerful rendering library designed to display complex vector and raster animations across multiple platforms including mobile, desktop, and web. It utilizes an efficient binary file format that supports all Adobe After Effects features while offering superior performance compared to traditional JSON-based solutions. Developers can leverage flexible runtime APIs to dynamically modify animation layers, text, and images to create highly interactive experiences.

// technical analysis

libpag is a high-performance, cross-platform rendering library designed to handle the PAG (Portable Animated Graphics) file format, which bridges the gap between complex Adobe After Effects animations and mobile or web applications. By utilizing a highly efficient binary format that supports both vector and raster data, it solves the performance and size limitations often associated with traditional animation formats like JSON. The project prioritizes developer flexibility through runtime editing APIs, allowing for dynamic content replacement and composition, while maintaining strict performance monitoring capabilities for designers.

// key highlights

01
Delivers a highly efficient binary format that decodes 10 times faster and is 50% smaller than JSON-based animation alternatives.
02
Provides full support for Adobe After Effects features by combining vector and raster exporting techniques into a single file.
03
Includes a built-in performance monitoring panel in PAGViewer to help designers optimize animations without requiring developer intervention.
04
Offers flexible runtime APIs that allow developers to modify layer structures, combine compositions, and replace text or images dynamically.
05
Supports a wide range of platforms including iOS, Android, OpenHarmony, macOS, Windows, Linux, and the Web.

// use cases

01
Rendering complex Adobe After Effects animations across iOS, Android, Web, and desktop platforms
02
Optimizing animation performance and file size using a highly efficient binary PAG format
03
Dynamically editing animation content like text and images at runtime for personalized user experiences

// getting started

To begin using libpag, download the precompiled libraries from the official releases page or integrate them via package managers like CocoaPods for iOS, Maven for Android, or OHPM for OpenHarmony. For web projects, you can initialize the library using the provided PAGInit script and load PAG files directly into a canvas element. Developers can further explore implementation details by referencing the official example repositories for their specific target platform.