Thor Vector Graphics is a lightweight portable library used for drawing vector-based scenes and animations including SVG and Lottie. It can be freely utilized across various software platforms and applications to visualize graphical contents.
This release includes several improvements and minor bug fixes:
Full Changelog: https://github.com/thorvg/thorvg/compare/v0.13.1...v0.13.2
This release includes several improvements and minor bug fixes:
Full Changelog: https://github.com/thorvg/thorvg/compare/v0.13.0...v0.13.1
After a period of three months of steadfast commitment, we are pleased to present the latest version of ThorVG. In this newly revised edition, we are eager to showcase a series of significant advancements. (Full Change Log)
ThorVG fundamentally utilizes the standard features of C++14, leveraging these capabilities to perform rendering task parallelization based on its custom-implemented task scheduler. It employs synchronization mechanisms such as std::thread and std::mutex during the parallelization process, which may be challenging to support on low-spec processors like the STM32. To enhance compatibility, we have further abstracted the task scheduler and locking system, ensuring ThorVG can be smoothly built even in environments that cannot accommodate such parallelization. If you wish to disable ThorVG's built-in locking & task scheduler, you can do so by adding the following option through the build configuration.
$meson setup builddir -Dthreads=false ...
To facilitate easy and quick installation of ThorVG on Windows, we have added ThorVG's package to the MSYS2 package manager. If you are a MingW user, you can now directly install and use the pre-packaged ThorVG on Windows.
Download and execute the MSYS2 installer on the web page above and follow the steps. When done, just launch one of the terminals in the start menu, according to the architecture and compiler you want (either 32 or 64 bits, with MSVCRT or UCRT library). Then you can install the ThorVG package :
pacman -S thorvg
To update to a newer release (and update all the packages, which is preferable), run :
pacman -Syu
Stability enhancements have been achieved through a series of comprehensive bug fixes, alongside significant improvements in Lottie format compatibility and notable advancements in Lottie rendering performance. Specifically, the optimization process for Lottie rendering has been refined, focusing on efficiently converting Lottie data into ThorVG commands for each frame. Our stress profiling tests have demonstrated a remarkable 38% enhancement in rendering performance when simultaneously executing 100 animations. Furthermore, this release marks the official introduction of two major new features.
Official support for fonts, text, and characters (glyphs) has now begun, enabling the output of basic text elements. This involves interpreting font and matching glyph vector information specified in the Lottie format to prepare the output graphics. Embedded layout information within the text element determines the size of each glyph, allowing for appropriate placement or the addition of animation effects. Text layout supports horizontal or vertical progression directions, as well as left, center, and right alignments. Additionally, graphical effects can be applied to characters based on the basic attributes of strokes outputtable by Lottie (such as join types, thickness, color, and dash patterns, etc).
ThorVG Lottie Text Animations
Lottie Slot is a feature that addresses a property, it enables dynamic and flexible animation customizations at runtime.
Dynamic Change of Fill Property via Slot
// Lottie Slots format example
// 'solid_fill' and 'gradient_fill' are the name of an SID that can be overridden with properties sharing the same name.
"slots": {
"solid_fill":{
"p":{
"a":0,
"k":[0.259, 1,0.518]
}
},
"gradient_fill": {
"p": {
"a": 0,
"k": [0, 0.1, 0.1, 0.2, 1, 1, 0.1, 0.2, 0.1, 1]
}
}
}
ThorVG Slot overriding feature allows for the manipulation of multiple properties within slot data (themes), seamlessly parsing and applying new properties to targeted properties(SIDs). As a result, this enhancement in ThorVG empowers users to implement essential theming features effectively. In this release, ThorVG supports the following properties for slot overriding:
Practically, during its integration with the dotLottie player, ThorVG refined this capability by allowing multiple properties to be applied and reverted, ensuring a more versatile and functional animation experience. The following code snippet demonstrates an example of the ThorVG slot overriding method. The following demonstrates how to use slot overriding with tvg::LottieAnimation. Please note that ThorVG has introduced the 'LottieAnimation' class, which extends the 'Animation' class. This class is specifically designed to support Lottie-related functionalities.
// Include a header file for lottie extension features.
#include <thorvg_lottie.h>
// Create a lottie animation.
auto lottie = LottieAnimation::gen();
// ThorVG Lottie constructs the LottieSlot data based on the property SIDs. If the current animation
// properties possess an SID value, these properties will be linked to the LottieSlot.
lottie->load(“sample.json”);
// In this example, Theme A contains only the “solid_fill” property, but it can include
// multiple properties as required.
auto themeA = R"({"solid_fill":{"p":{"a":0,"k":[0.259,1,0.518]}}})";
// When applying Theme A, ThorVG Lottie iterates over the given Theme A SID properties, identifies
// the target properties in the current animation that match the given SID name, and then parses
// and overrides these properties with new ones.
lottie->override(themeA);
// Reset the theme (Revert to the default)
lottie->override(nullptr);
For more information, Please explore Lottie Slot feature(aka. Theming) with the official dotLottie live player!
Dynamic Theme Change by the ThorVG Slot Overriding
Currently, the ThorVG Team is developing a WebGPU-based rendering engine to ensure the high performance of the next-generation graphics engine, while also considering the versatility across web and various platforms. In version 0.13, advanced features such as scene Blending, Composition, and super sampling based Anti-Aliasing have been further implemented. At present, we have secured the major advanced rendering features that ThorVG can support, and have successfully rendered animations within the wide range of Lottie specifications supported by ThorVG. Although it is still in the development stages, we will focus on enhancing stability and performance as we continue development towards the next version release.
Lottie Animations powered by ThorVG WebGPU Engine
ThorVG OpenGL/ES has been revised under an experimental version. Alongside WebGPU, this release has seen the addition of many advanced rendering features. Notably, Scene Blending, Composition, and multi sampling based Anti-Aliasing features have been newly introduced, allowing for the output of shapes with quite decent quality as a Vector Drawing Primitive engine.
Vector Primitive Drawings by ThorVG GL Engine
Note that currently, ThorVG only conducts rendering by specifying rendering targets through FBO, due to a known issue where drawing onto the main surface fails. This issue is anticipated to be resolved in the upcoming release as soon as possible.
//Create a GL Canvas
auto canvas = tvg::GlCanvas::gen();
//Prepare the target buffer with FBO
GLint targetId;
...
//Set the target buffer with Canvas
glCanvas->target(targetId, width, height);
Basically, ThorVG inherently supports two types of loader mechanisms for importing specific image formats: Static and External loaders. External loader refers to the method of dynamically linking ThorVG with external, fully-fledged libraries, while Static loader implies an implementation built-in ThorVG itself. The decision to support both approaches stems from the desire to leverage widely-used image libraries, which are often incorporated into systems as shared libraries to enhance the efficiency of both applications and the systems themselves. ThorVG is structured to utilize these libraries wherever possible, recommending their integration in native systems such as Android, iOS, Mac, Windows, Linux. However, in scenarios where this integration is challenging, ThorVG's built-in image loader can be utilized, offering users immediate access to these features without external dependencies, significantly enhancing ThorVG's portability. Consequently, users can configure either loader as needed when building the ThorVG binary.
Integration of ThorVG Image Loaders
In this release, ThorVG introduces support for a static WebP image loader, which can be enabled by configuring the ThorVG build options on your system or within your packages.
$meson setup builddir -Dloaders="webp, ...", -Dstatic=true, ...
The ThorVG team is developing the ThorVG Web component for web systems. This component includes integration with the ThorVG Live Viewer, Test-Automation, and the addition of essential features such as conversion from SVG to PNG, SVG to TVG and Lottie to GIF, aligning it with key web frameworks and apps such as VanilaJS, React, VueJS, Svelte.
The ThorVG Web component is currently in an experimental (beta version) stage, primarily supporting Lottie playback features. It is available through the npm packaging system. The official version will be confirmed alongside the ThorVG 1.0 release. You can download the latest ThorVG Web lottie-player here.
The ThorVG team has also prepared ThorVG Android, a project that facilitates the easy and quick packaging and installation of ThorVG in a cross-platform environment using the Android NDK and Gradle build tool. Currently, this project is in an experimental (beta version) state, with its code open for development, and, similar to the Web component, it primarily provides a user interface centered around Lottie playback functionality.
Result Animation::frame(float no)
Picture* Animation::picture() const
float Animation::curFrame() const
float Animation::totalFrame() const
float Animation::duration() const
static std::unique_ptr<Animation> Animation::gen()
Tvg_Colorspace::TVG_COLORSPACE_ABGR8888S
Tvg_Colorspace::TVG_COLORSPACE_ARGB8888S
Tvg_Animation* tvg_animation_new()
Tvg_Result tvg_animation_set_frame(Tvg_Animation* animation, float no)
Tvg_Paint* tvg_animation_get_picture(Tvg_Animation* animation)
Tvg_Result tvg_animation_get_frame(Tvg_Animation* animation, float* no)
Tvg_Result tvg_animation_get_total_frame(Tvg_Animation* animation, float* cnt)
Tvg_Result tvg_animation_get_duration(Tvg_Animation* animation, float* duration)
Tvg_Result tvg_animation_del(Tvg_Animation* animation)
Result GlCanvas::target(int32_t id, uint32_t w, uint32_t h)
Result LottieAnimation::override(const char* slot)
static std::unique_ptr<LottieAnimation> LottieAnimation::gen()
Result GlCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h)
Please check the API documentation for more details:
We also extend special thanks to the ThorVG contributors:
@hermet @JSUYA @tinyjin @SergeyLebedkin @RuiwenTang @ol-of @qarmin @mgrudzinska @MewPurPur @lmdsp @vtorri @capnm @kisvegabor @rinechran
This release includes several improvements and minor bug fixes:
Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.9...v0.12.10
This release includes several improvements and minor bug fixes:
Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.8...v0.12.9
This release includes several improvements and minor bug fixes:
Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.7...v0.12.8
This release includes several improvements and minor bug fixes:
Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.6...v0.12.7
This release includes several improvements and minor bug fixes:
Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.5...v0.12.6
This release includes several improvements and minor bug fixes:
Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.4...v0.12.5
This release includes several improvements and minor bug fixes:
Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.3...v0.12.4