Skip to content

Issue #356: Exporting CMYK/CMYKA TIFF files

Nikc requested to merge NikcDc/gimp:tiff-save-cmyk into master

Attempts to resolve the issue noted in #356 (closed), and allow TIFFs to be exported in 8 or 16 bit CMYK/CMYKA format. In addition to the Babl conversion via the assigned CMYK profile, the TIFFTAG_INKSET and TIFFTAG_NUMBEROFINKS attributes are set in metadata and the Photometric format is set to PHOTOMETRIC_SEPARATED. CMYK TIFFs generated by this code were compared with ones generated from Photoshop on the same color profile, and the results looked very similar when loaded in Photoshop/Scribus and inspected with ImageMagick (e.g. PS's mean Cyan value was 197.1 while GIMP's value was 197.082). Suggestions for additional tests are welcome. Additionally, a few gexiv2_metadata_clear_tag () lines were replaced with gexiv2_metadata_try_clear_tag () to remove warnings when compiling the plug-in code. (Per feedback from @Wormnest, these changes will be put in a new merge request)

(Code for loading CMYK files in GIMP can be found in !626 (merged)).

Notes: If the layer contains an alpha channel, the plug-in automatically converts using the "CMYKA" format in Babl which saves Alpha as a 5th channel. I'm not sure if that should be the default behavior, or a warning should inform the user of this behavior (or something else).

Notes: Krita was not able to import CMYK TIFFs made this way unless "Save Thumbnail" is unchecked on Export. It complains that the TIFF contains an unsupported color model. This is possibly because gimp_procedure_config_save_metadata () automatically creates an sRGB thumbnail, and Krita doesn't like the mixed colorspace for the layers.

Implementation referenced and reused from f200594d

Edited by Nikc

Merge request reports