
Using the script to scale at 750 px width with 10 frames per second, creating a non-looping gif:Īnimated gifs have excellent browser support, but these days video files are a very realistic alternative.

If you plan to use the commands outside of the script, note that the file selecting glob pattern will not work on Windows builds of ffmpeg. If you include the word loop as the final argument, it will create a looping gif. It extracts a palette file from the images in order to optimise the colours used.

The script reads all the images of the specified file type from the folder it is run. Next we will use these values with the "convert" command line tool which belongs to the ImageMagick suite.Ĭonvert -crop " -i $palette -lavfi "$filters paletteuse" -y -loop -1 "$2" In the case of the LibreOffice 6.0 images exported at 7500 px wide, the desired cropping values were:

Note down the x and y coordinates and width and height from the sidebar on the left. Zoom in close to the top left and bottom right corners to tweak it pixel perfect. Use the rectangular selection tool to surround only the area you want to keep. The next step is only needed, if your original work has unnecessary margins. To combat this, we need to export the images in a massive size. The LibreOffice 6.0 animation had one particular problem: the cuboid structure behind the number 6 uses 3D effects and the outer edges come out messy upon exporting as an image. ImageMagick and GIMP (only for mass cropping).We want the only compression step to be the creation of the gif or video. Exported images should be in a lossless format, typically PNG. This will keep the exported images high quality no matter how big the resolution. The important thing is to use vector graphics whenever possible. Even LibreOffice Draw can be used to create simple animations as evidenced by the 6.0 promotion piece. These instructions can be applied to any graphics software capable of handling multiple pages (and obviously to any animation software). The assumption is that you are using Linux with bash shell, but the instructions are adaptable to any platform. The source file is available as File:Lo60introcubes.odg.

This article is based on the work and research required to create a high quality animated gif banner for the promotion of LibreOffice 6.0.
