Thorvg Versions Save

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.

v0.13.2

2 weeks ago

This release includes several improvements and minor bug fixes:

Full Changelog: https://github.com/thorvg/thorvg/compare/v0.13.1...v0.13.2

v0.13.1

3 weeks ago

This release includes several improvements and minor bug fixes:

Full Changelog: https://github.com/thorvg/thorvg/compare/v0.13.0...v0.13.1

v0.13.0

1 month ago

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)


Infrastructure

Threading feature configuration

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 ...

MSYS2 package support

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

Lottie Animation

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.

Text elements support

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

Slot elements support

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:

  • Solid Stroke
  • Solid Fill
  • Gradient Stroke
  • Gradient Fill
  • Text Document

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


WebGPU Engine

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


OpenGL 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);

Static WebP Loader

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, ...

ThorVG Web

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.


ThorVG Android

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.


Major enhancements since v0.12.0

Renderer

  • Upgraded image up-scaler quality, resulting in smoother and more refined image enlargements. https://github.com/thorvg/thorvg/issues/1949
  • Improved image decoding efficiency through the application of premultiplied alpha channel and ensuring consistency in image colorspaces.
  • Increased picture format compatibility by accommodating inconsistent extension names.
  • Enhanced paint objects to retain their composition context, ensuring re-rendering accurately without update calls. https://github.com/thorvg/thorvg/issues/2058

SwEngine

  • Significantly improved the performance of image down-scaling.
  • Improved performance by retaining the compositor caches by default.

GlEngine

  • Improved to support for the even-odd fill rule.
  • Enhanced support for the gradient stroke path.
  • Added support for multi-sampling anti-aliased shape drawing using stencil mechanism.
  • Enhanced the tessellation algorithm for the reliable shape drawings.

WgEngine

  • Improved support for multiple gradient color stops to ensure compatibility with the Lottie animation specification.
  • Enhanced support for stroke trimming.
  • Added support for stroke/shape rendering order.
  • Added support for fill Rule & Spread behaviors.
  • Added support for super-sampling anti-aliased shape drawing.
  • Improved animation performance through optimization of internal resource management.
  • Newly support the thorvg blending options.
  • Newly support the scene composition behavior.

Lottie

  • Refined the rendering logic to eliminate unnecessary rendering contexts, ensuring more efficient animations.
  • Introduced support for slot overriding, aligning with the Lottie specification. https://github.com/thorvg/thorvg/issues/1808
  • Improved the scene building logic that led an unexpected image animation performance issues.
  • Enhanced compatibility with mismatched image formats with diverse assets.
  • Enhanced feature support for Text elements.

SVG

TTF

WebP

Web/Wasm

  • Improved the speed by revising the TVG saving logic.
  • Improved the 'stop animation' behavior: now stopping an animation resets it to the initial position.

Portability


Major bug fixes since v0.12.0

Renderer

SwEngine

GlEngine

  • Fixed broken behavior in radial gradient rendering.

Lottie

SVG

TTF

  • Resolved an issue with invalid Unicode encoding.

TVG

  • Enhanced the reliability of the saver logic.

WebP

Web/Wasm

  • Rectified the the broken GIF save logic.

Portability


API updates since v0.12.0

New official APIs

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()

New official C APIs

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)

New experimental APIs

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()

Experimental APIs Removal

Result GlCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h)

Please check the API documentation for more details:

Documentation, C++, CAPI


Contributors

We also extend special thanks to the ThorVG contributors:

@hermet @JSUYA @tinyjin @SergeyLebedkin @RuiwenTang @ol-of @qarmin @mgrudzinska @MewPurPur @lmdsp @vtorri @capnm @kisvegabor @rinechran

v0.12.10

1 month ago

This release includes several improvements and minor bug fixes:

Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.9...v0.12.10

v0.12.9

1 month ago

This release includes several improvements and minor bug fixes:

Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.8...v0.12.9

v0.12.8

1 month ago

This release includes several improvements and minor bug fixes:

Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.7...v0.12.8

v0.12.7

2 months ago

This release includes several improvements and minor bug fixes:

Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.6...v0.12.7

v0.12.6

2 months ago

This release includes several improvements and minor bug fixes:

Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.5...v0.12.6

v0.12.5

3 months ago

This release includes several improvements and minor bug fixes:

Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.4...v0.12.5

v0.12.4

3 months ago

This release includes several improvements and minor bug fixes:

  • [SwEngine] Resolved a specific case in the handling of trim paths, ensuring more accurate renderings. https://github.com/thorvg/thorvg/issues/1939
  • [Renderer] Fixed an issue where context loss would result in paints objects drawing invalid contents, enhancing stability and visual output.
  • [Lottie] Rectified errors in font/glyph and assets parsing, ensuring smoother integration and functionality.
  • [Lottie] Corrected text height alignment issues, improving layout consistency across Lottie animations.
  • [Lottie] Enhanced compatibility with mismatched image formats with diverse assets.
  • [SVG] Implemented the SVG specification for handling out-of-range elliptical arc parameters. https://github.com/thorvg/thorvg/issues/1937
  • [SVG] Corrected the handling of zero values for arc's rx and ry parameters, ensuring arcs are processed correctly in all scenarios.

Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.3...v0.12.4