Home

Awesome

KImageFormats

Plugins to allow QImage to support extra file formats.

Introduction

This framework provides additional image format plugins for QtGui. As such it is not required for the compilation of any other software, but may be a runtime requirement for Qt-based software to support certain image formats.

Formats

The following image formats have read-only support:

The following image formats have read and write support:

Contributing

See the QImageIOPlugin documentation for information on how to write a new plugin.

The main difference between this framework and the qimageformats module of Qt is the license. As such, if you write an imageformat plugin and you are willing to sign the Qt Project contributor agreement, it may be better to submit the plugin directly to the Qt Project.

Duplicated Plugins

The TGA plugin

The TGA plugin supports more formats than Qt's own TGA plugin; specifically, the one provided here supports indexed, greyscale and RLE images (types 1-3 and 9-11), while Qt's plugin only supports type 2 (RGB) files.

The code for this cannot be contributed upstream directly because of licensing. If anyone were willing to write fresh code to improve Qt's TGA plugin, it would allow the TGA plugin in this framework to be removed.

The DDS plugin

The DDS plugin is a fork of Qt 5.6 with bug fixes and improvements. It will be activated once the security issues are resolved.

License

This framework is licensed under the LGPLv2.1.

The CMake code in this framework is licensed under the BSD license.

Plugin status

The current implementation of a plugin may not be complete or may have limitations of various kinds. Typically the limitations are on maximum size and color depth.

The various plugins are also limited by the formats natively supported by Qt. For example, native support for CMYK images is only available since Qt 6.8.

HDR images

HDR images are supported via floating point image formats from DDS, EXR, HDR, JXL, JXR, PFM and PSD plugins. It is important to note that in the past these plugins stripped away HDR information, returning SDR images.

HDR images return R, G and B values ​​outside the range 0.0 - 1.0. While Qt painters handles HDR data correctly, some older programs may display strange artifacts if they do not use a tone mapping operator (or at least a clamp). This is not a plugin issue.

Metadata

Metadata support is implemented in all formats that support it. In particular, in addition to the classic "Description", "Author", "Copyright", etc... where possible, XMP data is supported via the "XML:com.adobe.xmp" key.

Please note that only the most common metadata is supported.

ICC profile support

ICC support is fully implemented in all formats that support it. When saving, some formats convert the image using color profiles according to specifications. In particular, HDR formats almost always convert to linear RGB.

Maximum image size

Where possible, plugins support large images. By convention, many of the large image plugins are limited to a maximum of 300,000 x 300,000 pixels. Anyway, all plugins are also limited by the QImageIOReader::allocationLimit(). Below are the maximum sizes for each plugin ('n/a' means no limit, i.e. the limit depends on the format encoding).

Sequential and random access devices

All plugins work fine on random access devices while only some work on sequential access devices. Some plugins, such as PSD, allow reading RGB images on sequential access devices, but cannot do the same for Lab files.

Important: some plugins use QIODevice transactions and/or QIODevice::ungetChar(). Therefore, the device used to read the image must not have any active transactions.

Memory usage

Qt has added many image formats over time. In older plugins, to support new formats, QImage conversion functions have been used, causing memory consumption proportional to the size of the image to be saved. Normally this is not a source of problems because the affected plugins are limited to maximum images of 2GiB or less.

On plugins for formats that support large images, progressive conversion has been used or the maximum size of the image that can be saved has been limited.

Non-RGB formats

PSD plugin loads CMYK, Lab and Multichannel images and converts them to RGB without using the ICC profile.

JXR, PSD and SCT plugins natively support 4-channel CMYK images when compiled with Qt 6.8+.

The DDS plugin

This plugin is disabled by default. It can be enabled with the KIMAGEFORMATS_DDS build option in the cmake file.

The following defines can be defined in cmake to modify the behavior of the plugin:

The HEIF plugin

This plugin is disabled by default. It can be enabled with the KIMAGEFORMATS_HEIF build option in the cmake file.

The EXR plugin

The following defines can be defined in cmake to modify the behavior of the plugin:

The HDR plugin

The following defines can be defined in cmake to modify the behavior of the plugin:

The JXL plugin

The current version of the plugin limits the image size to 256 megapixels according to feature level 5 of the JXL stream encoding.

The following defines can be defined in cmake to modify the behavior of the plugin:

The JXR plugin

This plugin is disabled by default. It can be enabled with the KIMAGEFORMATS_JXR build option in the cmake file.

The following defines can be defined in cmake to modify the behavior of the plugin:

The PSD plugin

PSD support has the following limitations:

The following defines can be defined in cmake to modify the behavior of the plugin:

The RAW plugin

Loading RAW images always requires a conversion. To allow the user to choose how to convert the image, it was chosen to use the quality parameter to act on the converter. The quality parameter can be used with values ​​from 0 to 100 (0 = fast, 100 = maximum quality) or by setting flags to selectively change the conversion (see also raw_p.h).

The default setting tries to balance quality and conversion speed.

The XCF plugin

XCF support has the following limitations: