Skip to content

Issue #19: Improve PSD Duotone support

Alx Sa requested to merge alxsa-duotone-psd-export into master

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:

  1. 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.

psd-duotone-load

(Note: If approved, this dialogue could be expanded on to also resolve issue #463 (closed))

  1. On export, psd_save () checks if the parasite exists and the image is still grayscale. If so, it displays an export dialogue:

FYZmMm7XgAEHpzZ

(Note: If approved, this dialogue will be expanded to also allow CMYK export)

  1. 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:

Funker_flyer_flat.png

Edited by Alx Sa

Merge request reports