On January 31, after a year and a half of continuous development, the 1.0 version of the lightweight and portable cross-platform vector graphics library was released. ThorVG, designed for visualizing vector scenes and animations. Files in the following formats are supported Lottie и SVG Tiny 1.2 (A list of implemented SVG Tiny features is available on the project's Wiki.).
The library provides convenient APIs for importing, creating, and displaying vector graphics, as well as exporting them to various graphic formats, making it universally applicable to various software platforms and applications for visualizing graphic content. The command-line utilities lottie2gif and svg2png are also included.
ThorVG is used for rendering vector graphics in projects such as Tizen OS, Godot Engine, Lvgl and players dotLottie.
The project is written in C++ (C++14 standard) and is distributed under the MIT license.
This isn't just an update—it's a rebuilt foundation for high-performance, scalable, and portable 2D vector graphics across all platforms and devices. Over the course of its development, ThorVG has evolved into a mature, production-ready graphics engine, demonstrating proven quality and performance in real-world applications.
ThorVG has quickly gained popularity and attracted growing interest from the community, reflecting its evolution from an early stage project to a widely recognized and widely used vector graphics engine ready for real cross-platform use.
List of changes:
- Advanced text rendering capabilities, rich visual effects, and precise overlay support for enhanced graphic expression
- Support for horizontal and vertical alignment allows for precise control over text placement in various UI contexts.
- Automatic line splitting with the ability to select the mode: by characters, by words, smart splitting and ellipsis truncation for overflow handling.
- Support for manual line breaks allows developers to explicitly control line breaks using newline characters such as \n. This allows for precise formatting of multi-line text blocks, especially in dynamic layouts or text animations.
- Support for adjustable character spacing, allowing for fine-tuning to improve readability or achieve specific typographic styles.
- Text outline support allows you to create stylistic effects and improve contrast on different backgrounds (screenshot 1).
- A more comprehensive and consistent blending mode system has been introduced, significantly improving blending mode behavior and aligning formulas and composition logic with industry standards such as Lottie, SVG, and the W3C Compositing and Blending specification. These improvements provide greater visual consistency and cross-platform compatibility, particularly in web and animation workflows.
- The following blending modes are implemented and supported: Hue, Saturation, Color, and Luminosity, using HSL color space compositing. These modes improve compatibility with Lottie layer effects and future SVG blending support (screenshot 2).
- Significant improvements and expansions to scene-level visual effects, making vector graphics more expressive and visually rich:
- Shadow effect with Gaussian Blur filter (video demonstration).
- Color replacement techniques that change the appearance of graphics by redefining the way colors are applied, mixed, or matched based on hue (video demonstration).
- New helper functions have been added to enhance interactive capabilities. These include support for spatial information queries (demonstration) and hit detection on displayed objects (video demonstration).
- Enhanced Lottie animation capabilities for cross-platform playback, including modular Web Player presets optimized for size, performance, and rendering mode (CPU/GPU)
- Significant improvements to Lottie animation support improve compatibility, flexibility, and interactivity across all platforms. Not only has the range of supported Lottie functions and expressions been expanded, but developer tools have been provided to dynamically control animation behavior at runtime, making ThorVG one of the most powerful Lottie playback libraries available. A list of implemented features is available on the project's Wiki..
- As of today, the .lot file extension is the new official IANA standard for Lottie files. ThorVG now officially supports .lot as the standard Lottie file format, in addition to the traditional .json extension.
- Twining
- Support for interpolation between nonlinearly adjacent keyframes has been added, enabling smoother transitions and more precise timing control. This improvement is particularly effective when used with state-based animation playback (also known as marker-based playback) in Lottie. In many cases, animations are designed to transition between states in complex, nonlinear ways. Traditional Lottie, with its strictly sequential timing structure, struggles to handle such scenarios, often resulting in abrupt drops or awkward jumps when transitioning between non-sequential keyframes: video demonstration 1, video demonstration 2.
- With tweening, developers can now interpolate directly between two individual keyframes, even if they are not linearly adjacent on the timeline. This allows for more natural and smooth visual effects during state transitions, significantly increasing the flexibility and realism of interactive animations: video demonstration 1, video demonstration 2.
- Now (as an experimental feature), runtime rewriting of expression variables is supported, allowing script logic to be dynamically executed based on user input. This makes it a particularly powerful tool for creating interactive animations using Lottie assets, allowing for custom variations that go beyond the original design.video demonstration).
- Added a customizable Asset Resolver engine, providing greater flexibility when loading external assets (such as images) referenced by Lottie animations.
- Expanded support for Lottie LayerEffect, allowing you to apply rich visual enhancements directly to animation layers with the effects described above.
- Since some effects can be resource-intensive, an option to adjust the quality and performance of effect rendering is available, ideal for optimization on CPU-constrained platforms. This allows developers to control rendering fidelity and optimize performance depending on the target platform.
- Expression support has been expanded with the addition of the following key functions and properties:
- wiggle, temporalWiggle: Apply random movement based on time.
- pointOnPath: Calculates the position along a path.
- propertyIndex, groupIndex: A reference to the index of a property or group.
- value, property, effect: access to property values and external effects.
- More accurate specification compliance:
- TextFollowPath is a new specification that allows text to follow arbitrary vector paths (video demonstration).
- Text Alignment Options – More accurate display of text layers based on their horizontal and vertical alignment settings (video demonstration).
- Mask Expansion is a new feature that allows you to more precisely control how the shape of a mask affects your visual composition (video demonstration).
- SVG
- ThorVG now allows you to access and modify individual SVG elements using unique id attributes defined in the SVG source file. This feature allows developers to directly select and manipulate specific vector shapes in an imported SVG scene, ideal for interactive or dynamic use cases (e.g., theming, highlighting).
- Support Gaussian blur effect.
- Intelligent rendering
- The ThorVG software engine now supports intelligent partial rendering, which enables more efficient rendering workflows by updating only those parts of a vector scene that have changed. By internally tracking changed regions, it minimizes unnecessary redraws and optimizes overall performance. This feature provides significant benefits in scenarios such as UI rendering, design tools, or applications in which most of the scene remains static and only small elements are updated between frames. In such cases, avoiding full scene rendering can significantly reduce computational load and improve power efficiency, which is especially valuable for mobile and embedded systems.
- To achieve this goal, ThorVG 1.0 utilizes a combination of algorithmic methods specifically designed for partial rendering. The key strategies underlying this system are as follows:
- Linear Pass Algorithm: The shapes are sorted by x-coordinates and a linear pass strategy is used to reduce unnecessary checks of dirty regions. This reduces the complexity from O(N × M) to O(N + M + K + N log N), where N is the number of shapes, M is the number of dirty regions, and K is the number of actual overlaps.
- Splitting and conditional merging: fine-grained sub-region splitting is balanced by intelligent merging to avoid fragmentation. Horizontal merging is prioritized for more efficient memory cache utilization.
- Spatial Subdivision (default 4x4 grid): The rendering surface is divided into 16 regions, allowing only the corresponding "dirty" areas of shapes to be checked, significantly reducing overhead during complex UI updates.
- Working together, these techniques provide smoother and faster rendering, especially in embedded or real-time systems where partial updates are frequent. More details will be published in a separate post. Blog.
- Please note that for highly dynamic content, such as fast-paced games or full-screen animations where nearly all objects change every frame, partial rendering provides little or no performance benefit and may even incur a slight overhead. In such cases, full scene rendering is typically a better choice. For this reason, ThorVG supports both partial and full rendering configurations, allowing you to choose the optimal approach for your use case. You can analyze your product's performance and make an informed decision using the Meson -Dpartial=[true/false] option and the EngineOption::Smart option of the SwCanvas class:
auto canvas = SwCanvas::gen(EngineOption::Smart);
- A new era of web integration with WebGL, WebGPU, and the lightweight WebCanvas for seamless rendering in the browser
- The WebGL and WebGPU backends are now officially ready for production use. These GPU-based renderers now offer full interoperability with the traditional CPU backend, supporting all ThorVG Canvas features with the same image quality and stability. Compared to version 0.15, GPU rendering performance has increased by over 150%, delivering a significant improvement in real-time web vector graphics rendering.
- Significant performance improvements in CPU/GPU constrained and embedded environments
- ThorVG 1.0 offers improved performance over version 0.15, with noticeable gains for both CPU and GPU.
- Key optimizations:
- Improved rendering pipeline efficiency.
- Reduced frame buffer allocation overhead.
- Optimized Lottie composition analysis.
- Improved batch rendering and GPU caching.
- ThorVG is optimized for CPU-based rasterization, with a focus on vector rendering in environments where GPU resources are limited, unavailable, or intentionally underutilized. In typical CPU benchmarks, ThorVG demonstrates an average of 1.8x faster performance than the widely used Skia vector graphics engine when performing typical vector rendering tasks. This advantage is particularly evident in geometry-intensive scenarios such as rendering rectangles, strokes, rotations, and circles (screenshot 3).
- ThorVG Janitor
- A real-world demonstration of ThorVG's rendering performance can be seen in the project ThorVG Janitor – an interactive game designed to showcase processor performance under heavy graphics load. The scene includes hundreds of enemies created using particle-based graphics, multi-layered starry sky backgrounds with full-size bitmaps, real-time visual effects such as DropShadow and Blur, and up to 25000 objects rendered simultaneously. Even at peak load at 2K resolution (2048×1152), the project demonstrates stable performance above 120 FPS, highlighting ThorVG's efficiency and suitability for complex, effect-heavy environments.video demonstration, screenshot).
- Other significant changes
- An example of ThorVG integration in Godot. As for the this video demonstration ThorVG is integrated with Godot in a web environment to render hundreds of Lottie animation objects at over 120 frames per second. This demo demonstrates ThorVG's potential in a web environment for smooth, high-quality animation at runtime.
- Added teaching example using ThorVG WebCanvas.
- Added interactive ThorVG Playground.
- Added ThorVG wrapper for Swift: https://github.com/thorvg/thorvg.swift.
- ThorVG usage examples have been moved to a separate repository https://github.com/thorvg/thorvg.example.
- Extension published thorvg.vscode for VSCode to create, edit, and preview ThorVG resources directly within Visual Studio Code.
- Version 1.0 includes a significant API restructuring aimed at improving performance, usability, consistency, and compatibility with C.
- Support for the TVG Picture (TVG) format has been removed. This decision was made to prepare for the new ThorVG Picture format, designed with animation as its core concept.
- Numerous bug fixes and stability improvements for production use.
Source: linux.org.ru
