Skip to content

Commit 3f3b29b

Browse files
hodefotingJehan
authored and
Jehan
committed
app, libgimp, pdb: fix perceptual blend space for linear TRC ICC profiles
In previous versions what has been stored/specified as perceptual blending or compositing spaces has really been the non-linear variant of the images babl space. To maintain loading of old files, the code has been updated to actually mean non-linear and a new perceptual value has been added to the GimpLayerColorSpace enum, while preserving all old enum values. This change bumps XCF file version to 23
1 parent c380d28 commit 3f3b29b

13 files changed

+148
-58
lines changed

app/actions/layers-actions.c

+16
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,12 @@ static const GimpRadioActionEntry layers_blend_space_actions[] =
321321
GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
322322
NULL },
323323

324+
{ "layers-blend-space-rgb-non-linear", NULL,
325+
NC_("layers-action", "RGB (from color profile)"), NULL, { NULL },
326+
NC_("layers-action", "Layer Blend Space: RGB (from color profile)"),
327+
GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
328+
NULL },
329+
324330
{ "layers-blend-space-rgb-perceptual", NULL,
325331
NC_("layers-action", "RGB (perceptual)"), NULL, { NULL },
326332
NC_("layers-action", "Layer Blend Space: RGB (perceptual)"),
@@ -342,6 +348,12 @@ static const GimpRadioActionEntry layers_composite_space_actions[] =
342348
GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
343349
NULL },
344350

351+
{ "layers-composite-space-rgb-non-linear", NULL,
352+
NC_("layers-action", "RGB (from color profile)"), NULL, { NULL },
353+
NC_("layers-action", "Layer Composite Space: RGB (from color profile)"),
354+
GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
355+
NULL },
356+
345357
{ "layers-composite-space-rgb-perceptual", NULL,
346358
NC_("layers-action", "RGB (perceptual)"), NULL, { NULL },
347359
NC_("layers-action", "Layer Composite Space: RGB (perceptual)"),
@@ -920,6 +932,8 @@ layers_actions_update (GimpActionGroup *group,
920932
action = "layers-blend-space-auto"; break;
921933
case GIMP_LAYER_COLOR_SPACE_RGB_LINEAR:
922934
action = "layers-blend-space-rgb-linear"; break;
935+
case GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR:
936+
action = "layers-blend-space-rgb-non-linear"; break;
923937
case GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL:
924938
action = "layers-blend-space-rgb-perceptual"; break;
925939
default:
@@ -935,6 +949,8 @@ layers_actions_update (GimpActionGroup *group,
935949
action = "layers-composite-space-auto"; break;
936950
case GIMP_LAYER_COLOR_SPACE_RGB_LINEAR:
937951
action = "layers-composite-space-rgb-linear"; break;
952+
case GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR:
953+
action = "layers-composite-space-rgb-non-linear"; break;
938954
case GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL:
939955
action = "layers-composite-space-rgb-perceptual"; break;
940956
default:

app/core/gimpimage.c

+14
Original file line numberDiff line numberDiff line change
@@ -2951,6 +2951,20 @@ gimp_image_get_xcf_version (GimpImage *image,
29512951
*/
29522952
version = MAX (22, version);
29532953
}
2954+
2955+
if ((gimp_layer_get_real_blend_space (layer) == GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL)
2956+
||(gimp_layer_get_real_composite_space (layer) == GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL))
2957+
{
2958+
ADD_REASON (g_strdup_printf (_("Blending space fixes in %s"),
2959+
"GIMP 3.0"));
2960+
/* The blending space variant corresponding to SPACE_RGB_PERCEPTUAL in <3.0
2961+
* corresponds to R'G'B'A which is NON_LINEAR in babl. Perceptual in babl is
2962+
* R~G~B~A, >= 3.0 the code, comments and usage matches the existing enum value
2963+
* as being NON_LINEAR and new layers created use the new interger value for
2964+
* PERCEPTUAL.
2965+
*/
2966+
version = MAX (23, version);
2967+
}
29542968
}
29552969
g_list_free (items);
29562970

app/dialogs/layer-options-dialog.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,12 @@ layer_options_dialog_new (GimpImage *image,
194194
private);
195195

196196
space_model =
197-
gimp_enum_store_new_with_range (GIMP_TYPE_LAYER_COLOR_SPACE,
198-
GIMP_LAYER_COLOR_SPACE_AUTO,
199-
GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL);
197+
gimp_enum_store_new_with_values (GIMP_TYPE_LAYER_COLOR_SPACE,
198+
4,
199+
GIMP_LAYER_COLOR_SPACE_AUTO,
200+
GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
201+
GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
202+
GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL);
200203

201204
private->blend_space_combo = combo =
202205
gimp_enum_combo_box_new_with_model (GIMP_ENUM_STORE (space_model));

app/gegl/gimp-gegl-nodes.c

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ gimp_gegl_create_flatten_node (GeglColor *background,
4242

4343
g_return_val_if_fail (GEGL_IS_COLOR (background), NULL);
4444
g_return_val_if_fail (composite_space == GIMP_LAYER_COLOR_SPACE_RGB_LINEAR ||
45+
composite_space == GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR ||
4546
composite_space == GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
4647
NULL);
4748

app/operations/layer-modes/gimp-layer-modes.c

+50-47
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static const GimpLayerModeInfo layer_mode_infos[] =
6565
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
6666
.paint_composite_mode = GIMP_LAYER_COMPOSITE_UNION,
6767
.composite_mode = GIMP_LAYER_COMPOSITE_UNION,
68-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
68+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
6969
},
7070

7171
{ GIMP_LAYER_MODE_DISSOLVE,
@@ -90,7 +90,7 @@ static const GimpLayerModeInfo layer_mode_infos[] =
9090
GIMP_LAYER_MODE_CONTEXT_FILTER,
9191
.paint_composite_mode = GIMP_LAYER_COMPOSITE_UNION,
9292
.composite_mode = GIMP_LAYER_COMPOSITE_UNION,
93-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
93+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
9494
},
9595

9696
{ GIMP_LAYER_MODE_MULTIPLY_LEGACY,
@@ -103,8 +103,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
103103
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
104104
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
105105
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
106-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
107-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
106+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
107+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
108108
},
109109

110110
{ GIMP_LAYER_MODE_SCREEN_LEGACY,
@@ -117,8 +117,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
117117
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
118118
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
119119
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
120-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
121-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
120+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
121+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
122122
},
123123

124124
{ GIMP_LAYER_MODE_OVERLAY_LEGACY,
@@ -131,8 +131,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
131131
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
132132
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
133133
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
134-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
135-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
134+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
135+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
136136
},
137137

138138
{ GIMP_LAYER_MODE_DIFFERENCE_LEGACY,
@@ -145,8 +145,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
145145
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
146146
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
147147
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
148-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
149-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
148+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
149+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
150150
},
151151

152152
{ GIMP_LAYER_MODE_ADDITION_LEGACY,
@@ -159,8 +159,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
159159
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
160160
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
161161
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
162-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
163-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
162+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
163+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
164164
},
165165

166166
{ GIMP_LAYER_MODE_SUBTRACT_LEGACY,
@@ -173,8 +173,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
173173
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
174174
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
175175
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
176-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
177-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
176+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
177+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
178178
},
179179

180180
{ GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY,
@@ -187,8 +187,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
187187
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
188188
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
189189
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
190-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
191-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
190+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
191+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
192192
},
193193

194194
{ GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY,
@@ -201,8 +201,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
201201
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
202202
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
203203
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
204-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
205-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
204+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
205+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
206206
},
207207

208208
{ GIMP_LAYER_MODE_HSV_HUE_LEGACY,
@@ -215,8 +215,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
215215
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
216216
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
217217
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
218-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
219-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
218+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
219+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
220220
},
221221

222222
{ GIMP_LAYER_MODE_HSV_SATURATION_LEGACY,
@@ -229,8 +229,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
229229
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
230230
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
231231
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
232-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
233-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
232+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
233+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
234234
},
235235

236236
{ GIMP_LAYER_MODE_HSL_COLOR_LEGACY,
@@ -243,8 +243,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
243243
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
244244
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
245245
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
246-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
247-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
246+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
247+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
248248
},
249249

250250
{ GIMP_LAYER_MODE_HSV_VALUE_LEGACY,
@@ -257,8 +257,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
257257
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
258258
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
259259
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
260-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
261-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
260+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
261+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
262262
},
263263

264264
{ GIMP_LAYER_MODE_DIVIDE_LEGACY,
@@ -271,8 +271,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
271271
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
272272
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
273273
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
274-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
275-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
274+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
275+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
276276
},
277277

278278
{ GIMP_LAYER_MODE_DODGE_LEGACY,
@@ -285,8 +285,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
285285
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
286286
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
287287
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
288-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
289-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
288+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
289+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
290290
},
291291

292292
{ GIMP_LAYER_MODE_BURN_LEGACY,
@@ -299,8 +299,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
299299
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
300300
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
301301
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
302-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
303-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
302+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
303+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
304304
},
305305

306306
{ GIMP_LAYER_MODE_HARDLIGHT_LEGACY,
@@ -313,8 +313,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
313313
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
314314
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
315315
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
316-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
317-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
316+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
317+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
318318
},
319319

320320
{ GIMP_LAYER_MODE_SOFTLIGHT_LEGACY,
@@ -327,8 +327,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
327327
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
328328
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
329329
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
330-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
331-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
330+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
331+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
332332
},
333333

334334
{ GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY,
@@ -341,8 +341,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
341341
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
342342
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
343343
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
344-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
345-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
344+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
345+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
346346
},
347347

348348
{ GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY,
@@ -355,8 +355,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
355355
.context = GIMP_LAYER_MODE_CONTEXT_ALL,
356356
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
357357
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
358-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
359-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
358+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
359+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
360360
},
361361

362362
{ GIMP_LAYER_MODE_COLOR_ERASE_LEGACY,
@@ -372,8 +372,8 @@ static const GimpLayerModeInfo layer_mode_infos[] =
372372
GIMP_LAYER_MODE_CONTEXT_FILTER,
373373
.paint_composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
374374
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
375-
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
376-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
375+
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR,
376+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
377377
},
378378

379379
{ GIMP_LAYER_MODE_OVERLAY,
@@ -545,7 +545,7 @@ static const GimpLayerModeInfo layer_mode_infos[] =
545545
.paint_composite_mode = GIMP_LAYER_COMPOSITE_UNION,
546546
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
547547
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
548-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
548+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
549549
},
550550

551551
{ GIMP_LAYER_MODE_HSV_SATURATION,
@@ -557,7 +557,7 @@ static const GimpLayerModeInfo layer_mode_infos[] =
557557
.paint_composite_mode = GIMP_LAYER_COMPOSITE_UNION,
558558
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
559559
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
560-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
560+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
561561
},
562562

563563
{ GIMP_LAYER_MODE_HSL_COLOR,
@@ -569,7 +569,7 @@ static const GimpLayerModeInfo layer_mode_infos[] =
569569
.paint_composite_mode = GIMP_LAYER_COMPOSITE_UNION,
570570
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
571571
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
572-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
572+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
573573
},
574574

575575
{ GIMP_LAYER_MODE_HSV_VALUE,
@@ -581,7 +581,7 @@ static const GimpLayerModeInfo layer_mode_infos[] =
581581
.paint_composite_mode = GIMP_LAYER_COMPOSITE_UNION,
582582
.composite_mode = GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
583583
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
584-
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
584+
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR
585585
},
586586

587587
{ GIMP_LAYER_MODE_DIVIDE,
@@ -1533,9 +1533,12 @@ gimp_layer_mode_get_format (GimpLayerMode mode,
15331533
case GIMP_LAYER_COLOR_SPACE_RGB_LINEAR:
15341534
return babl_format_with_space ("RGBA float", preferred_format);
15351535

1536-
case GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL:
1536+
case GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR:
15371537
return babl_format_with_space ("R'G'B'A float", preferred_format);
15381538

1539+
case GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL:
1540+
return babl_format_with_space ("R~G~B~A float", preferred_format);
1541+
15391542
case GIMP_LAYER_COLOR_SPACE_LAB:
15401543
return babl_format_with_space ("CIE Lab alpha float", preferred_format);
15411544
}

0 commit comments

Comments
 (0)