Issue #19: Improve PSD Duotone support
This patch attempts to improve existing PSD Duotone support (as requested in issue #19 (closed)), by allowing users to export PSDs in Duotone mode if they were Duotone when originally imported. Per Adobe specifications, PSD readers/writers can load Duotone images as grayscale and copy over the Duotone color space data on export.
The Duotone color space data was already being saved as a parasite with the label PSD_PARASITE_DUOTONE_DATA
. The following additions were made:
- After the image is loaded,
psd_load ()
checks if that parasite exists and displays a compatibility dialogue to notify the user of the current support level.
(Note: If approved, this dialogue could be expanded on to also resolve issue #463 (closed))
- On export,
psd_save ()
checks if the parasite exists and the image is still grayscale. If so, it displays an export dialogue:
(Note: If approved, this dialogue will be expanded to also allow CMYK export)
- In
save_image ()
, the parasite and grayscale status will be confirmed and the option disabled if the criteria are not met (e.g. users choosing this option for non-Duotone images in non-interactive mode). If verified, the PSD header mode will be set to 8 (PSD_DUOTONE) and the untouched Duotone color space information will be written in the color space header section (the same as the Indexed colormap currently is).
Sample File: https://gitlab.gnome.org/GNOME/gimp/uploads/00bae458f2bdb9a7030b9a6b23f7256b/Funker_flyer_flat.psd
Example of file when opened in Photoshop: