Commit dccaa5d5 authored by Ell's avatar Ell

plug-ins: in file-psd, use SRC_OVER and RGB_PERCEPTUAL for all layers

Use SRC_OVER, instead of SRC_ATOP, as the composite mode for all
layers (or use AUTO, when it results in SRC_OVER), to match
Photoshop's behavior.  Use RGB_PERCEPTUAL as the blend and composite
space, instead of AUTO, whose interpretation depends on the specific
layer mode, to match Photoshop's behavior for RGB images.  Use NORMAL
mode, instead of NORMAL_LEGACY, with the above properties, for normal
layers, for consistency with the other layer modes, which don't (and,
indeed, can't) use the legacy modes.
parent 4d3481ca
......@@ -1412,6 +1412,11 @@ add_layers (gint32 image_id,
layer_mode = psd_to_gimp_blend_mode (lyr_a[lidx]->blend_mode, &layer_composite);
gimp_layer_set_mode (layer_id, layer_mode);
gimp_layer_set_composite_mode (layer_id, layer_composite);
/* FIXME: use perceptual blending and compositing
* unconditionally for now
*/
gimp_layer_set_blend_space (layer_id, GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL);
gimp_layer_set_composite_space (layer_id, GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL);
gimp_layer_set_opacity (layer_id,
lyr_a[lidx]->opacity * 100 / 255);
gimp_item_set_name (layer_id, lyr_a[lidx]->name);
......@@ -1469,6 +1474,11 @@ add_layers (gint32 image_id,
image_type, lyr_a[lidx]->opacity * 100 / 255,
layer_mode);
gimp_layer_set_composite_mode (layer_id, layer_composite);
/* FIXME: use perceptual blending and compositing for all layers
* for now
*/
gimp_layer_set_blend_space (layer_id, GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL);
gimp_layer_set_composite_space (layer_id, GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL);
IFDBG(3) g_debug ("Layer tattoo: %d", layer_id);
g_free (lyr_a[lidx]->name);
gimp_image_insert_layer (image_id, layer_id, parent_group_id, 0);
......
......@@ -613,15 +613,18 @@ psd_to_gimp_blend_mode (const gchar *psd_mode,
* "union", effectively, only returning "auto" for modes that default to
* "union", to reduce UI clutter.
*/
if (layer_composite) *layer_composite = GIMP_LAYER_COMPOSITE_SRC_ATOP;
if (layer_composite) *layer_composite = GIMP_LAYER_COMPOSITE_SRC_OVER;
if (g_ascii_strncasecmp (psd_mode, "pass", 4) == 0) /* Pass through (CS)*/
{
if (layer_composite) *layer_composite = GIMP_LAYER_COMPOSITE_AUTO;
return GIMP_LAYER_MODE_PASS_THROUGH;
}
if (g_ascii_strncasecmp (psd_mode, "norm", 4) == 0) /* Normal (ps3) */
{
if (layer_composite) *layer_composite = GIMP_LAYER_COMPOSITE_AUTO;
return GIMP_LAYER_MODE_NORMAL_LEGACY;
return GIMP_LAYER_MODE_NORMAL;
}
if (g_ascii_strncasecmp (psd_mode, "dark", 4) == 0) /* Darken (ps3) */
......@@ -732,7 +735,7 @@ psd_to_gimp_blend_mode (const gchar *psd_mode,
mode_name);
}
if (layer_composite) *layer_composite = GIMP_LAYER_COMPOSITE_AUTO;
return GIMP_LAYER_MODE_NORMAL_LEGACY;
return GIMP_LAYER_MODE_NORMAL;
}
if (g_ascii_strncasecmp (psd_mode, "lgCl", 4) == 0) /* Lighter Color */
......@@ -744,7 +747,7 @@ psd_to_gimp_blend_mode (const gchar *psd_mode,
mode_name);
}
if (layer_composite) *layer_composite = GIMP_LAYER_COMPOSITE_AUTO;
return GIMP_LAYER_MODE_NORMAL_LEGACY;
return GIMP_LAYER_MODE_NORMAL;
}
if (CONVERSION_WARNINGS)
......@@ -757,7 +760,7 @@ psd_to_gimp_blend_mode (const gchar *psd_mode,
if (layer_composite) *layer_composite = GIMP_LAYER_COMPOSITE_AUTO;
return GIMP_LAYER_MODE_NORMAL_LEGACY;
return GIMP_LAYER_MODE_NORMAL;
}
gchar *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment