Add JPEG 2000 support

JPEG 2000 support using OpenJPEG library.

- Add read/write support to JP2/J2K format for Gray/RGB(A)/CMYK images @8/16-bits
- Read test case images generated by Photoshop

The plugin has the following limitations:
- Resolution is not set (JP2_RES box is marked "For the future" in jp2.h)
- Metadata are not set (as with resolution)

Closes #13
This commit is contained in:
Mirco Miranda
2025-01-05 10:36:21 +00:00
committed by Albert Astals Cid
parent e6a0f8758b
commit c97ee00f5e
61 changed files with 962 additions and 2 deletions

View File

@ -32,6 +32,7 @@ The following image formats have read and write support:
- DirectDraw Surface (dds)
- Encapsulated PostScript (eps)
- High Efficiency Image File Format (heif)
- JPEG 2000 (jp2, j2k, jpf)
- JPEG XL (jxl)
- JPEG XR (jxr)
- OpenEXR (exr)
@ -75,6 +76,12 @@ The DDS plugin is a fork from Qt 5.6 with bug fixes and improvements.
The plugin was forked because Qt Project no longer supports its DDS plugin.
### The JP2 plugin
The JP2 plugin is based on the popular and wide used OpenJPEG library.
The Qt project has a no longer supported JPEG 2000 plugin based on Jasper.
## License
This framework is licensed under the
@ -134,6 +141,7 @@ plugin ('n/a' means no limit, i.e. the limit depends on the format encoding).
- EPS: n/a
- HDR: n/a (large image)
- HEIF: n/a
- JP2: 300,000 x 300,000 pixels
- JXL: 262,144 x 262,144 pixels, in any case no larger than 256 megapixels
- JXR: n/a, in any case no larger than 4 GB
- KRA: same size as Qt's PNG plugin
@ -178,8 +186,8 @@ been used or the maximum size of the image that can be saved has been limited.
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+.
JP2, JXR, PSD and SCT plugins natively support 4-channel CMYK images when
compiled with Qt 6.8+.
### The DDS plugin
@ -218,6 +226,15 @@ create a temporary PDF file which is then converted to EPS. Therefore, if
The following defines can be defined in cmake to modify the behavior of the plugin:
- `HDR_HALF_QUALITY`: on read, a 16-bit float image is returned instead of a 32-bit float one.
### The JP2 plugin
**This plugin can be disabled by setting `KIMAGEFORMATS_JP2` to `OFF`
in your cmake options.**
JP2 plugin has the following limitations due to the lack of support by OpenJPEG:
- Metadata are not supported
- Image resolution is not supported
### The JXL plugin
**The current version of the plugin limits the image size to 256 megapixels