Qt plug-in to allow Qt and KDE based applications to read/write AVIF images.
Manual How to install AVIF support in KDE
AV1 Image File Format (AVIF) is an advanced image format specified by Alliance for Open Media.
AVIF is technically a picture compressed with AV1 video codec wrapped in ISO Base Media File Format.
AV1 compression provides significantly better efficiency than traditional JPEG. Beside 8bit per channel AVIF allows 10bit and 12bit depth, transparency, color profiles, metadata, animation, compression quality ranging from visually lossless to highly compressed lossy while maintaining decent visual quality at low bitrates.
Download Latest Release and extract the content of the zip file:
unzip qt-avif-image-plugin-0.8.6.zip
Recommended: read README.txt
If you have shared-mime-info 2.0 or newer installed, you may skip this step. AVIF MIME type are installed already.
In order to install mime type image/avif in your system, copy (as root) qt-avif-image-plugin.xml file to /usr/share/mime/packages/ folder and run:
update-mime-database /usr/share/mime
Qt Image Plugin allows Qt and KDE applications to open/save pictures in AVIF format. The plug-in uses libavif internally.
You need Qt5 development packages (for example qtbase5-dev), qmake, you may also need cmake and yasm.
If your system has libavif installed (version 0.8.2 or newer, check for the presence of /usr/include/avif/avif.h), run:
If you don't have libavif installed, run:
This alternative requires extra-cmake-modules
mkdir build
cd build
cmake ..
make
Use same steps like building under Linux.
You need to prepare libaom.a and libavif.a before opening qt-avif-image-plugin_local-libavif.pro in Qt Creator.
Create folder ext\libavif\ext\aom\build.libavif\
and change to this folder.
Run C:\Qt\Tools\CMake_64\bin\cmake.exe -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release -DENABLE_DOCS=0 -DENABLE_EXAMPLES=0 -DENABLE_TESTDATA=0 -DENABLE_TESTS=0 -DENABLE_TOOLS=0 -DCONFIG_PIC=1 ..
cmake should create project files for Visual Studio. Now you can open AOM.sln
Go to Configuration Manager... and change (if necessary) Active solution configuration from Debug to Release.
Build Solution
Copy and rename ext\libavif\ext\aom\build.libavif\Release\aom.lib
to ext\libavif\ext\aom\build.libavif\libaom.a
Create folder ext\libavif\build\
and change to this folder.
Run C:\Qt\Tools\CMake_64\bin\cmake.exe -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DAVIF_CODEC_AOM=ON -DAVIF_LOCAL_AOM=ON ..
cmake should create project files for Visual Studio. Now you can open libavif.sln
Go to Configuration Manager... and change (if necessary) Active solution configuration from Debug to Release.
Build Solution
Copy and rename ext\libavif\build\Release\avif.lib
to ext\libavif\build\libavif.a
Build Project qt-avif-image-plugin_local-libavif
Plug-in is ready in plugins\imageformats\qavif.dll
Copy libqavif.so to a folder where qt5-image-formats-plugins and/or kimageformats are installed. It could be one of these locations:
- /usr/lib/qt5/plugins/imageformats
- /usr/lib/qt/plugins/imageformats/
- /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats
Qt based applications should be able to open AVIF images now.
Example how to associate AVIF file type with gwenview:
Copy avif.desktop, avifs.desktop to:
/usr/share/kservices5/qimageioplugins/
Update imagethumbnail.desktop (in /usr/share/kservices5/ ):
Add ;image/avif
to the MimeType=
list: