Releases: thorvg/thorvg
ThorVG 0.10.6
This release includes fixes for the following issues:
- [SwEngine] Resolved an issue with ghost artifacts on single lines caused by zero-sized visual drawing.
- [SwEngine] Corrected anti-aliased blending discrepancies in 8-bit grayscale composition.
- [SwEngine] Enhanced support for 8-bit grayscale Radial/Linear gradient composition, addressing Gradients Matting composition issues in Lottie Animation.
- [SwEngine] Improved rendering behavior to display a single dot when a zero-length bezier curve/line is provided with a stroke width.
- [Lottie] Stabilized the engine by addressing several crashes resulting from invalid memory access.
- [Lottie] Rectified the loss of precomp matting composition.
- [Lottie] Enhanced the Hold Interpolation functionality, which was previously missing for Paths/Gradients.
- [Lottie] Fixed the proper propagation of opacity values during scene rendering.
ThorVG 0.10.5
This release includes fixes for the following issues:
- [Renderer] Addressed a regression bug related to thread-safety. #1623
- [SVG] Improved support for the focal property of radial gradients. #1555
- [Lottie] Improved support for the focal property of radial gradients.
- [Lottie] Enhanced support for proper hold interpolation.
- [Lottie] Enhanced support for gradient dash stroke.
- [Lottie] Added support for the repeater feature.
- [Lottie] Implemented support for 3D transformations.
- [Lottie] Fixed an issue with incorrect viewport clipping.
- [Lottie] Corrected a computation error in precomp time remapping.
ThorVG 0.10.4
This release includes fixes for the following issues:
- [Renderer] Fixed a bezier curve computation error in an exceptional scenario.
- [Renderer] Fixed an issue of a missing stroke miterlimit property copy in duplicated shapes.
- [SwEngine] Corrected inaccurate subtract/intersect masking behaviors within chain-masking.
- [SwEngine] Fixed incorrect antialiasing issue when small stroking is overlapped with shapes.
- [Lottie] Fixed a crash issue caused by incorrect gradient alpha handling.
- [Lottie] Corrected a default color of the solid layer.
- [Lottie] Enhanced the coverage of the rounded corner feature.
- [Lottie] Enhanced the trimpath feature.
- [Portability] Fixed empty-body compile errors.
ThorVG 0.10.3
This release includes fixes for the following issues:
- [SVG] Ensure proper support for the objectBoundingBox value of clipPathUnits and for the userSpaceOnUse value of maskContentUnits. #429
- [SVG] Ensure proper support for dash-stroking offset.
- [Lottie] Ensure proper support for dash-stroking offset.
- [Lottie] Ensure proper support for Polystar property.
- [Renderer] Fix a composition issue where gradient stroke and a valid fill were handled together. #445
- [Renderer] Resolve a deadlock problem that occurred when a picture embedded another picture's resources.
ThorVG 0.10.2
This release includes fixes for the following issues:
- [SVG] Corrected handling of clips with multiple transformed shapes, and added support for "use" nodes within the clips.
- [Lottie] Ensured proper support for embedded images.
- [Lottie] Fixed the issue with incorrect precomp layer frame timing.
- [Lottie] Prevented the display of layers when the frame is out of range.
- [Lottie] Implemented proper error handling for cases of invalid lottie files.
- [Lottie] Enhanced support for solid color layers.
- [Lottie] Improved support for mask layers.
ThorVG 0.10.1
This release includes fixes for the following issues:
- [Portability] Resolved a compilation error that occurred when using MingGW, specifically related to the "_USE_MATH_DEFINES" directive.
- [Lottie] Significantly improved overall stability for a smoother user experience.
- [Lottie] Fixed an issue where the time-remapping feature was not functioning correctly.
- [Lottie] Corrected the radial gradient type, ensuring it now operates as intended.
- [Lottie] Rectified the behavior of the "rd" (rounded corner) feature, which was not working as expected.
- [Lottie] Addressed an issue with dashed strokes, ensuring they are now displayed accurately.
ThorVG v0.10.0
After three months of dedicated work, we are thrilled to announce the release of a new version of ThorVG. In this updated version, we are excited to introduce several significant enhancements.
Lottie
First and foremost, ThorVG has initiated support for Lottie Animation, a JSON-based vector animation file format designed for seamless distribution across all platforms, much like distributing static assets. These compact files retain compatibility with a multitude of devices, offering scaleability without any pixelation. Lottie allows for easy creation, editing, testing, collaboration, and distribution of animations in a highly user-friendly way. For more information, please visit LottieFiles' website.
It's important to note that while ThorVG is dedicated to achieving complete support for Lottie Animation, the current release only provides experimental support. While most features are covered, a few advanced properties of Lottie may not be fully operational yet:
- Maskings
- Trimpath
- Images
- Texts
- Polystar
- Repeater
- Merge-path
- Filter Effects
- Expressions
Given the rapid growth of Lottie Animation's user base in the industry, ThorVG is intensifying its efforts to augment the currently missing features. Our aim is to offer support for most of these missing elements in our forthcoming release, ensuring our focus aligns with user demand and industry trends.
Lottie feature is tagged as a "beta" feature. Therefore, if you wish to utilize the Lottie loading capability, we recommend manually enabling this feature.
$meson . -Dloaders="lottie_beta", ...
The following code snippet demonstrates how to use ThorVG to play a Lottie animation.
auto animation = tvg::Animation::gen(); //generate an animation
auto picture = animation->picture() //acquire a picture which associated with the animation.
picture->load("lottie.json"); //load a Lottie file
auto duration = animation->duration(); //figure out the animation duration time in seconds.
canvas->push(tvg::cast(picture)); //push the picture into the canvasFirst, an animation and a picture are generated. The Lottie file (lottie.json) is loaded into the picture, and then the picture is added to the canvas. The animation frames are controlled using the animation object to play the Lottie animation. Also you might want to know the animation duration time to run your animation loop.
animation->frame(animation->totalFrame() * progress); //Set a current animation frame to display
canvas->update(animation->picture()); //Update the picture to be redrawn.Let's suppose the progress variable determines the position of the animation, ranging from 0 to 1 based on the total duration time of the animation. Adjusting the progress value allows you to control the animation at the desired position. Afterwards, the canvas is updated to redraw the picture with the updated animation frame.
Webp
Another significant ongoing contribution is the support for the TVG WebP loader. WebP, a raster graphics file format developed by Google, is designed to replace JPEG, PNG, and GIF file formats. It accommodates both lossy and lossless compression, alongside animation and alpha transparency. Currently, its functionality is limited to external linking, and it's tagged as a "beta" feature. Therefore, if you wish to utilize the WebP loading capability, we recommend manually enabling this feature.
$meson . -Dloaders="webp_beta", ...
Maskings
The existing Masking methods supported in TVG were Alpha, Inverse Alpha, Luma. However, we are currently adding five new modes required by Lottie: Inverse Luma, Add, Subtract, Difference, and Intersect. These five options being added require a significant amount of implementation in the raster routines, as they involve handling various raster branches such as rectangles, shapes, direct images, scaled-up/down images, clipped images, transformed images, (linear/radial) gradients, and clipped version gradients. Instead of simply creating a RenderTarget to composite the masking image and target image, the current implementation approach allows immediate composition without additional RenderTarget, minimizing performance/memory costs even though it presents implementation challenges.
Blendings
Basically, TVG was equipped with the Alpha-Blending feature. Alpha Blending is the most representative color synthesis method and is used in most cases. In this update, we offer additional types of Blending functions provided in AE, in addition to the existing Alpha Blending. As a result, the TVG blending options are currently offered as follows under the beta:
[normal, screen, multiply, overlay, srcOver, darken, lighten, colorDodge, colorBurn, hardLight, softLight, difference, exclusion]
Some feature validation might be needed, but once the base work has been incorporated, we could address errors or security issues through subsequent development and then improve them. These improvements can generally be made quickly and easily through the addition or improvement of blending formulas.
So far, the four blending options are supported in AE but not in TVG. We still have a plan to add them as necessary.
[hue, saturation, color, luminosity]
For more information, please refer to the "Paint::blend()" API documentation.
StrokeMiter
We would like to express our gratitude towards an external contributor, @capnm, for introducing the "StrokeMiterLimit" feature. This functionality effectively limits the extension length of the stroke's join part, a feature crucial to both SVG and Lottie. Although it was initially overlooked in TVG due to its non-immediate necessity, it has now been incorporated in response to external requirements. For more information, please refer to the "Shape::strokeMiterlimit()" API documentation.
Feature changes
We are planning to modify the behavior policy of the canvas. This is expected to occur in the 1.0 release, and as preparatory work for this, we are gradually changing some features. The original canvas's clear(free = false) operation removed all paint objects preserved by the canvas, but our new behavioral policy aims to minimize screen updates for the next frame by continuing to maintain them. For this purpose, ThorVG users can directly access the paint nodes they hold through Canvas::paints() or Scene::paints(), and if necessary, they can selectively delete unnecessary nodes by directly modifying the list. Given these considerations, the next paints() API will be added and reserve() is expected to be removed, so please refer to this when upgrading to version 1.0.
- std::list<Paint*>& Canvas::paints()
- std::list<Paint*>& Scene::paints()
- Result Canvas::reserve(uint32_t size)
- Result Scene::reserve(uint32_t size)
Here are the major enhancements and bug fixes since version 0.9.0:
[Enhancements]
- [Engine] Enhanced blending operations for optimal performance.
- [Engine] Streamlined rasterization in 64-bit systems. #1471
- [Engine] Minimized the memory usage of a paint node by reducing it by 9 bytes, achieved through efficient packing of the internal data.
- [SVG] Implemented support for the '!important' directive. #1255
[Bug Fixes]
- [Engine] Rectified a composition issue of the Picture. #1423
- [Engine] Fixed an incorrect stroking composition issue. #209
- [Engine] Resolved inaccurate stroking rendering when its width is extremely small.
- [Engine] Addressed memory leaks and violations for improved system performance.
- [SVG] Rectified incorrect behavior of the "use" node when referencing another "use" node. #1451
- [SVG] Resolved inaccurate interpretation of the "def" node in a corner case scenario.
- [TVG] Corrected an issue with improper shape merging when saving to the TVG binary format. #1440
- [JPEG] Fixed memory leaks associated with the static JPEG loader.
- [Portability] Solved a regression issue related to Windows compilation when using thorvg static linking. #1446
The following enumerates the updates made to the APIs since v0.9.0:
[New APIs]
- enum class CompositeMethod::LumaMask
- Result Picture::load(uint32_t* data, uint32_t w, uint32_t h, bool copy) noexcept
- unique_ptr(Picture) Accessor::set(std::unique_ptr picture, std::function<bool(const Paint* paint)> func)
- static Accessor::std::unique_ptr gen()
- Result Shape::order(bool strokeFirst)
[Deprecations]
- Result Canvas::reserve(uint32_t size) noexcept
- Result Scene::reserve(uint32_t size) noexcept
The following enumerates the updates made to the BETA APIs since v0.9.0:
Please be aware that a few BETA APIs have been added and removed. While some of them are functional, we strongly advise against using them as they may undergo modifications or be removed in future versions.
[New Additions]
- template(typename T) std::unique_...
ThorVG v0.9.0
It has been 1 year and 2 months of work since ThorVG 0.8, and we are thrilled to announce the release of a new version of ThorVG.
In this release, we are excited to introduce the new ThorVG Logo, beautifully designed by @projectitis, who made a significant contribution.
Additionally, ThorVG now supports the Paint Mesh feature, although it is currently in the BETA version and not fully completed. We would like to share this upcoming feature that ThorVG will have in the official release, as it allows users to create stunning effects.
Here are some prototypes created by @projectitis:
head_animation_from_rive_community.mp4
In addition to these exciting additions, we have optimized the software rasterizer to minimize memory usage in the rendering sequence. Particularly, the Masking Composition now uses a 1-byte channel memory, reducing the memory size by 3x. This optimization work is highly effective and beneficial for optimizing the runtime resources of compact applications.
Furthermore, Thorvg has upgraded the Catch2 test framework from v2.13.6 to v2.13.10 and now provides support package installation through vcpkg with the help of @rinechran. You can refer to the ThorVG README for instructions on how to install the ThorVG package using vcpkg.
ThorVG now features a robust logging method, providing more useful information to understand the runtime behavior of ThorVG and identify potential issues. If you wish to use the logging method, please enable the feature in the meson options by using the following command:
meson -Dlog=true ...
Also, we have introduced an SVG regression test for CI to ensure the powerful prevention of regression bugs during ThorVG's development. This task was successfully completed by @qarmin, who has done an exceptional job.
Lastly, beware that this release might break your ThorVG compatibility since the SVG usage has been corrected. We know this is an unusual, uncomfortable result, however it's inevitable. Please check the SVG example(src/examples/SVG.cpp) if the aspect-ratio of your SVG images are incorrect.
//See how to deal with the image scaling while keeping aspect-ratio.
float scale;
float shiftX = 0.0f, shiftY = 0.0f;
float w, h;
picture->size(&w, &h);
if (w > h) {
scale = SIZE / w;
shiftY = (SIZE - h * scale) * 0.5f;
} else {
scale = SIZE / h;
shiftX = (SIZE - w * scale) * 0.5f;
}
picture->scale(scale);
picture->translate((count % NUM_PER_ROW) * SIZE + shiftX, (count / NUM_PER_ROW) * (HEIGHT / NUM_PER_COL) + shiftY);
Here is a list of major enhancements and bug fixes since v0.8.0:
[Enhancements]
- Added support for the ABGR colorspace from the image loaders. (Issue reference: #1310
- Enhanced the SVG loader to properly support CSS styles.
- Improved the logging method. #1351
- Added support for the SceneClipping feature. #524
- Enhanced the performance of the ThreadScheduler.
- Achieved a 3x reduction in memory footprint for AlphaMask by implementing a grayscale channel buffer. #976
[Bug Fixes]
- Corrected a rendering result issue when the skew transformation is applied.
- Resolved a nested masking rendering issue when chain composition is used. #1295
- Fixed the incorrect alpha channel colorspace results in static image loaders. #1320
- Addressed the lack of data capacity in big size shape dash strokes, which was causing rendering issues.
- Rectified the incorrect SVG viewbox region caused by inaccurate data types (int -> float).
- Improved the SVG gradient inheritance function. #1209
- Fixed the SVG loader to correctly parse empty tags.
- Fixed the SVG loader to correctly read the 'infinity' property.
- Fixed crashes that occurred when parsing the SVG due to a locale change. #1389
- Allowed SVG text to have a space after the omitted floating numbers "0. ".
- Corrected the wrong clip's opacity/alpha behavior in SVG. #1192
- Fixed the SVG loader to not calculate stroke size of the paint bounds when strokes were invalid.
- Enhanced the stability of the SVG loader and fixed exceptional cases that could result in stack overflow and infinite loops.
- Fixed the SVG loader to handle the preserveAspectRatio attribute according to the SVG standards.
- Resolved the SVG loader image masking problem.
- Fixed the SVG loader's invalid '<' nested check for doctype elements.
- Corrected the handling of viewbox width/height info from the symbol node in the SVG loader.
- Addressed a segfault issue when an SVG gradient has no 'id' attribute.
- Fixed the color interpretation issue in the SVG loader when colors are given in percentages (e.g., "rgb(10%,20%,30%)").
- Fixed building errors on macOS.
- Resolved a crash on macOS that occurred when using a huge size of an embedded image in an SVG.
- Fixed Windows compilation issues and enhanced compatibility for Windows support.
- Fixed compilation issues on FreeBSD/OpenBSD.
- Addressed compilation issues with GCC13.
- Fixed a compatibility issue with MinGW builds.
- Resolved an issue where examples would crash when image loaders were disabled.
- Fixed minor memory leak problems.
Here are the new official APIs:
- enum class CompositeMethod::LumaMask
- Result Picture::load(uint32_t* data, uint32_t w, uint32_t h, bool copy) noexcept
Please be aware that a few BETA APIs have been added and removed. While some of them are functional, we strongly advise against using them as they may undergo modifications or be removed in future versions.
[Additions]
- Result Shape::order(bool strokeFirst) noexcept
- Result Picture::mesh(const Polygon* triangles, uint32_t triangleCnt) noexcept
- uint32_t Picture::mesh(const Polygon** triangles) const noexcept
- std::unique_ptr set(std::unique_ptr picture, std::function<bool(const Paint* paint)> func) noexcept
- struct Vertex
- struct Polygon
[Removal]
- std::unique_ptr access(std::unique_ptr picture, bool(func)(const Paint paint, void* data), void* data) noexcept
Lastly, special thanks to our dedicated contributors:
@hermet
@mgrudzinska
@JSUYA
@fire
@projectitis
@qarmin
@capnm
@vtorri
@rinechran
@mundusnine
ThorVG v0.8.4
This release includes fixes for the following bugs:
- Corrected an issue with an incorrect SVG viewbox region caused by inaccurate data types(int -> float).
- Fixed building errors on macOS.
- Allowed SVG text to have a space after the omitted floating numbers "0. "
- Corrected a wrong rendering result when the skew transformation is applied.
- Fixed a wrong nested masking rendering issue when chain composition is used. #1295
- Fixed an issue where examples would crash when image loaders were disabled.
- Fixed a crash on macOS that occurred when a huge size of an embedded image was used in an SVG.
- Corrected the wrong clip's opacity/alpha behavior in SVG. #1192
- Added support for the ABGR colorspace from the image loaders. #1310
- Fixed an issue where the static image loaders would give wrong alpha channel colorspace results. #1320
- Fixed the SVG loader to not calculate stroke size of the paint bounds when strokes were invalid."
ThorVG v0.8.3
This release contains the following bug fixes.
- Fix minor memory leak problems.
- Enhance SVG loader to be more stable, fix some exceptional cases which fall into stack overflow and infinite-loop.
- Fix SVG loader to handle preserveAspectRatio attribute according to the SVG standards.
- Fix SVG loader to interpret whole nodes from its data-tree properly.
- Fix SVG loader image masking problem.
- Enhance SVG loader to support proper CSS styles.
- Fix Windows compilation issues and enhance the compatibility for Windows support.
- Fix FreeBSD/OpenBSD compilation issues.
Beware that this release might break your ThorVG compatibility since the SVG usage has been corrected. We know this is an unusual, uncomfortable result, however it's inevitable. Please check the SVG example(src/examples/SVG.cpp) if the aspect-ratio of your SVG images are incorrect.
//See how to deal with the image scaling while keeping aspect-ratio.
float scale;
float shiftX = 0.0f, shiftY = 0.0f;
float w, h;
picture->size(&w, &h);
if (w > h) {
scale = SIZE / w;
shiftY = (SIZE - h * scale) * 0.5f;
} else {
scale = SIZE / h;
shiftX = (SIZE - w * scale) * 0.5f;
}
picture->scale(scale);
picture->translate((count % NUM_PER_ROW) * SIZE + shiftX, (count / NUM_PER_ROW) * (HEIGHT / NUM_PER_COL) + shiftY);