Qt Image Formats

The core Qt Gui library by default supports reading and writing image files of the most common file formats: PNG, JPEG, BMP, GIF and a few more, ref. Reading and Writing Image Files. The Qt Image Formats add-on module provides optional support for other image file formats.

The file format support is provided transparently, through plugins for Qt's image I/O system. As such, this module provides no API of its own. Instead, the functionality is accessed in the same way as other image I/O in Qt: through QImage::load() and QImage::save(). Or, for more detailed control, through QImageReader and QImageWriter.

The Image I/O Plugins

The actual coding and decoding of the file format is done by a codec library. The codec can be Qt or third party code. In case of a third party codec, the build process will look for it among the system libraries. If not found, it may fall back on using a bundled copy (in src/3rdparty).

FormatDescriptionSupport3rd Party Codec
ICNSApple Icon ImageRead/writeNo
JP2Joint Photographic Experts Group 2000Read/writeYes (Not bundled)
MNGMultiple-image Network GraphicsReadYes (Not bundled)
TGATruevision Graphics AdapterReadNo
TIFFTagged Image File FormatRead/writeYes (bundled)
WBMPWireless BitmapRead/writeNo
WEBPWebPRead/writeYes (bundled)

Note: Some bundled third party codecs are not maintained anymore. They are provided for manual builds only, and not used as a fallback in case system libraries are unavailable.

Note: For security reasons, the Direct Draw Surface (DDS) handler is not built by default since Qt 5.8. Users who still want this handler can build it from the source project.

Deployment

When built, the Qt Image Formats plugins are located as dynamic libraries in the runtime plugin directory (typically plugins/imageformats), together with the default image format plugins. They may be deployed to the target system in the same way as other plugins, see the Deploying Plugins documentation.

Licenses and Attributions

Qt Image Formats is available under commercial licenses from The Qt Company. In addition, it is available under the GNU Lesser General Public License, version 3, or the GNU General Public License, version 2. See Qt Licensing for further details.

Furthermore Qt Image Formats potentially contains third party modules under following permissive licenses:

TIFF Software Distribution (libtiff), version 4.1.0

libtiff License

WebP (libwebp), version 1.0.3

BSD 3-clause "New" or "Revised" License

Security considerations

Since these file formats are more rarely used, the codecs may be less thoroughly debugged against potential security holes. As always, care should be taken when creating applications that may be used to decode uncontrolled data files.

© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.