Lottie4J Project

Goal of the Lottie4J project

Provide a set of Java libraries that can

  • Parse existing Lottie animations to Java objects.

  • Generate Lottie files from Java objects.

  • Play Lottie animations in JavaFX.

  • And achieve this by using a recent Java version with the use of Records to minimize the code and make the project easy to maintain, test, and extend.

Current status

20240201

I’m working on this, but slowly…​ Not sure if I should create a full JavaFX player myself or integrate with e.g. the work Alessio Vinerbi is doing with MoonsonFX, his "After Effects"-like application written in JavaFX. Maybe a conversion from Lottie-format to the format he is using would be a good approach…​ In the meantime, whenever I have time, I dive deeper into the Lottie format to fully understand it.

This announcement seems to be pretty important: Announcing Lottie as a Standard with Lottie Animation Community (LAC) Format Specification Body. Lottie gets a big push to become an even more "efficient, scalable and cross-platform animated vector graphics technology and open file format". To be continued…​

20230222

Hmm, the Lottie data format is harder to understand than I hoped…​ I already knew it’s not a logical nested structure, but actually there is a lot of references to data in other structures inside the JSON.

So, to be honest, I’m in the typical worst point that every project faces…​

Graph showing the emotions in a project

But on the bright side, we have our first correct color and stroke width output! The right pink border is the same as on the left, so I know where to find some info to be used in the drawing…​

Graph showing the emotions in a project

20230206

Based on a LottieFile with an animation, created with Flow, the Bezier object needed to be extended in two different objects: FixedBezier and AnimatedBezier.

  • Core

    • Added FixedBezier and AnimatedBezier with BezierDeserializer

    • Extended unit tests

  • FXPlayer and FXDemo

    • Loading of initial test file

    • Position, colors, strokes…​ still to be done

Loaded animation file and start of generating the first frame

20230124

  • Core: can already load many different JSON files

    • But not all yet…​

    • To be added to the unit tests and the model needs to be further extended

    • See FileLoaderTest.java#L38

  • FXPlayer: very basic visualizer

    • Can read a basic Lottie JSON file and draw the paths

    • See below with DemoApplication.java showing the original Lottie on the left, and the very first JavaFX generated image on the right.

Status of Lottie4J JavaFX player on 20230123

Last website build: 01/02/2024 08:04 (UTC)
Visitor counter by Clicky