A Python tool for converting .gif files (or folders containing .gifs) and into animated .avif files using avifenc and Pillow.
Keeps gif transparency and frame durations intact for the final .avif file
the resulting .avif file is placed in the same folder as the .gif file
python gif_to_avif.py path/to/gif_file.gif [--quality N]or
python gif_to_avif.py path/to/folder/ [--quality N]--quality N: (optional, default 60) (integer: 0 <= N <= 100)
Note: quality above 90 isn't worth the trouble, you won't really see quality improvement and the file size can be bigger than the original .gif file
Recommended settings:
- basically lossless: 90
- little compression & super high quality: 80
- compression & great quality: 60
- good compression & fine quality: 40
- great compression & some detail: 30
- full compression: 20
- maybe some pixels left: 10
Note: noisy gifs lose their detail faster than smoother gifs, they are also harder to compress
Note:
avifencmust be callable from commandline from the .py file with:avifenc [commands]
Install Pillow for python with pip:
pip install PillowInstall avifenc:
Follow avifenc installation guide for command line install
or
download from their release page
This project is licensed under the MIT License - see the LICENSE file for details.