How can you convert JPEG frames into animated JPEG-XL?

Basically, the whole process is using a suitable tool, JPEG frames are converted to JPEG-XL for use in creating web-based animated images. After that, the animation’s specifications are defined, it is encoded, and the browser compatibility is checked.

The processes for archiving flawless, lossless animations are to convert JPEG frames to lossless JPEG-XL, create animation details, encode the animation without loss, and finally save or share the finished file.

Here is the list of the methods you can use for turning a series of JPEG frames into an animated JPEG-XL sequence:

1. JPEG Frames to JPEG-XL Format Conversion

Using a program or library that is JPEG-XL compatible, start by converting each of your JPEG frames to the JPEG-XL format. The cjxl command-line utility from the JPEG-XL reference implementation is one example of a tool in this category.

For example,

  • Use this command to change a JPEG frame into the JPEG-XL format
    cjxl input.jpg output.jxl
  • cjxl represents the command-line utility for the conversion of images to the JPEG-XL format.
  • input.jpg is the name of the JPEG frame you wish to convert.
    * output.jxl is the designation you provide for the resulting JPEG-XL file.

The JPEG frame (input.jpg) will be converted into the JPEG-XL format and saved as output.jxl after the execution of this command. To carry out this conversion, please make sure the cjxl utility is installed and available in your command-line environment.

Additionally, you can change the input and output filenames to correspond with the names and locations of your unique files.

2. Develop an Animation Sequence

  • By defining the sequence and length of each frame, you may create an animated sequence.
    • Text files

      • To generate a text file that contains the animation details, use common text editors like Notepad, Visual Studio Code, or Sublime Text. According to the specifications listed in the JPEG-XL manual, you define the sequence and length of each frame in the text file.
    • Scripting Languages

      • Animation sequence files can be created programmatically using languages like Python, JavaScript, or Ruby. If your animation logic is complicated or you have a lot of frames, this method is really helpful.
    • Animation Software

      • You can generate and export animations along with animation sequence data using some animation applications, such as Adobe Animate or Toon Boom Harmony. Your animation can either be converted after export or exported in a JPEG-XL-compatible format.
    • Command - Line Tools

      • You can also create animation sequences using command-line tools, depending on the needs and accessible tools. The JPEG-XL encoder software might include these resources.

It’s important to refer to the JPEG-XL literature for the particular requirements as the format for defining animations in JPEG-XL may change.

3. Animated sequence encoding

  • Encode the series of frames along with the animation information using a JPEG-XL encoder that supports animations. Again, for further instructions or techniques to create an animated JPEG-XL file, refer to the encoder’s manual.

For example,

  • Command to encode an animated JPEG-XL sequence

  • jxl --animation-info animation.txt --frames frame_1.jxl frame_2.jxl frame_3.jxl -o animated_sequence.jxl

  • jxl is the command-line tool for the JPEG-XL encoder.

  • --animation-info animation.txt specifies the animation information, including the order and duration of frames. You should create the animation.txt file with the necessary animation details.

  • --frames frame_1.jxl frame_2.jxl frame_3.jxl lists the individual frames of your animation. Ensure you have these frames saved as JPEG-XL files.

  • -o animated_sequence.jxl specifies the output file where the animated JPEG-XL sequence will be saved.

4. Replay and evaluation

Test the generated animated JPEG-XL file in all programs or web browsers that allow animated JPEG-XL to play to make sure everything works as it should.

  • Manual Testing

    • Open a terminal window or command prompt to get started.
    • Next, use the ‘cd’ command to get to the directory containing your animated JPEG-XL file. Use the syntax shown below:
    • cd /path/to/your/animated_jxl_directory
  • Web Browser

    • Launch Google Chrome to take advantage of the animated JPEG-XL capability it offers with the experimental flags enabled.
    • To start Chrome playing your animated JPEG-XL file, enter the following command:
    • google-chrome --enable-blink-features=Image-JXL my_animation.jxl
    • This command will launch Chrome and start playing the my_animation.jxl animated JPEG-XL file.

This is how you can turn JPEG-XL frames into animation.

1 Like