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


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


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


  • 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: 22/02/2023 15:24 (UTC)