Skip to content

Windows batch script to convert GIF animations and WEBP animations to AVIF. Also converts static images to AVIF.

License

Notifications You must be signed in to change notification settings

oep42/Convert-GIF-animations-to-AVIF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

This is a ready-to-go Windows batch script to convert GIF animations and WEBP animations to AVIF. To convert an animation to AVIF, this script uses a lossless intermediate format consisting of a series of temporary PNG files.

This Windows batch script can do the following:

  • Convert animated GIF to animated AVIF
  • Convert animated WEBP to animated AVIF
  • Convert static GIF/WEBP image to static AVIF image.
  • Optional: Convert static PNG/JPG/JPEG image to static AVIF image.
  • Optional: For an animation: Add a suffix to output filename which indicates it is an animation.
  • Optional: Automatically skip overwriting of existing files in the output directory.
  • Optional: Preserve the file date and time of the input file in the output file.
  • Optional: Make the output files read-only.
  • Optional: Delete all existing files from the output directory when this script starts.
  • Optional: Reduce the size (width x height) of a static image during conversion, if it is bigger than a specified maximum.
  • See the beginning of the script (after "BEGINNING OF: USER SETTINGS") for these options.

Limitations of this script:

  • Animations with unequal frame durations are not fully supported. After conversion, each frame will have the same duration and the total duration will be the same as in the original animation.
  • For animations, all metadata will be lost during the conversion process.

To use this script:

  • Download the file "Convert-animations-and-images-to-AVIF.bat".
  • Open this file in Notepad, locate the text after "BEGINNING OF: USER SETTINGS", and specify the input directory containing the image/animation files to be converted.
  • In addition, change settings there if needed.
  • Save the .bat file.
  • Double-click the .bat file to run the script.

The output directory of this script is a subdirectory of its input directory. The output directory will be created if it does not exist. The name of the output directory is "Output to AVIF".

This script requires certain files to be present on the computer. The following programs should be available and their location should be added to PATH in the system environment variables of Windows:

Animated AVIF can be viewed in the Imagine freeware image & animation viewer for Windows — https://www.nyam.pe.kr/dev/imagine/

About

Windows batch script to convert GIF animations and WEBP animations to AVIF. Also converts static images to AVIF.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published