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:
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.
- Use this command to change a JPEG frame into the JPEG-XL format
cjxl input.jpg output.jxl
cjxlrepresents the command-line utility for the conversion of images to the JPEG-XL format.
input.jpgis the name of the JPEG frame you wish to convert.
output.jxlis 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.
- By defining the sequence and length of each frame, you may create an animated sequence.
- 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.
- 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.
- 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.
- 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.
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.txtspecifies the animation information, including the order and duration of frames. You should create the animation.txt file with the necessary animation details.
frame_1.jxl frame_2.jxl frame_3.jxllists the individual frames of your animation. Ensure you have these frames saved as JPEG-XL files.
-o animated_sequence.jxlspecifies the output file where the animated JPEG-XL sequence will be saved.
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.
- 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:
- 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.