Skip to content

Initial support for CMYK JPEGXL import and export

Alx Sa requested to merge alxsa-cmyk-jpegxl-import into master

This patch attempts to add support for importing and exporting CMYK/A JPEGXL images. A reference CMYK image can be found here: https://github.com/libjxl/conformance/tree/master/testcases/cmyk_layers

The format stores the K value in a separate channel (currently ignored by GIMP), which is labeled as JXL_CHANNEL_BLACK. This patch checks for the existence of this channel; if so, it assumes the image is intended to be CMYK. It loads the K data into a buffer, then appends it via GeglBufferIter to the CMY buffer to create a final CMYK/A image. The alpha channel is optionally loaded if it exists. The CMYK profile is also stored as the image's simulation profile.

Before and After:

Current Patch
before cmyk-jpgxl-progress

Update: CMYK/A export is now supported as well. The Key channel (and Alpha if it exists) are extracted from the image and stored in extra channel(s). The simulation color profile is also stored - in fact, this is a requirement of the specification, so CMYK/A export without a profile is disabled. The output was confirmed as CMYK via the jxlinfo utility included in the libjxl library:

image

Edited by Alx Sa

Merge request reports

Loading