From 85e919e9ce29f736283429d4da40aba0a6765205 Mon Sep 17 00:00:00 2001 From: Jehan Date: Fri, 30 Jan 2026 23:13:19 +0100 Subject: [PATCH] app: default Curves and Levels to working in linear space. This was always planned, as outlined in commit 54d3beab9c. As a stroke of luck, even though this default change had never happened, it turned out that these 2 filters were always run in linear, when called from the API (cf. #15681). This is now fixed, and as a consequence, setting the default TRC to linear would make sure that any script which was calling "gimp:levels" with default "trc" would still run exactly the same (and if the prop was set, it was broken anyway). As for "gimp:curves", it could not even have been used anyway, because of the lack of the GimpCurve type in libgimp. Therefore, plug-in API-wise, we can consider that changing the default is actually the less breakage, which is good news as it fits our plans! As for XCF storing of filters, since we are storing all the properties anyway, it doesn't break XCF files with these filters either. --- app/operations/gimpcurvesconfig.c | 4 ++-- app/operations/gimplevelsconfig.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/operations/gimpcurvesconfig.c b/app/operations/gimpcurvesconfig.c index 1c3c39c0fe..fe2d0fd64f 100644 --- a/app/operations/gimpcurvesconfig.c +++ b/app/operations/gimpcurvesconfig.c @@ -105,7 +105,7 @@ gimp_curves_config_class_init (GimpCurvesConfigClass *klass) _("Tone Reproduction Curve"), _("Work on linear or perceptual RGB, or following the image's TRC"), GIMP_TYPE_TRC_TYPE, - GIMP_TRC_NON_LINEAR, 0); + GIMP_TRC_LINEAR, 0); /* "linear" is a compat property initially kept for compatibility * reason, in particular for config parsing. It's not needed anymore @@ -117,7 +117,7 @@ gimp_curves_config_class_init (GimpCurvesConfigClass *klass) "linear", _("Linear"), _("Work on linear RGB (this property is ignored; use \"trc\" instead)"), - FALSE, 0); + TRUE, 0); GIMP_CONFIG_PROP_ENUM (object_class, PROP_CHANNEL, "channel", diff --git a/app/operations/gimplevelsconfig.c b/app/operations/gimplevelsconfig.c index 158bd6f453..d88f358999 100644 --- a/app/operations/gimplevelsconfig.c +++ b/app/operations/gimplevelsconfig.c @@ -111,7 +111,7 @@ gimp_levels_config_class_init (GimpLevelsConfigClass *klass) _("Tone Reproduction Curve"), _("Work on linear or perceptual RGB, or following the image's TRC"), GIMP_TYPE_TRC_TYPE, - GIMP_TRC_NON_LINEAR, 0); + GIMP_TRC_LINEAR, 0); /* "linear" is a compat property initially kept for compatibility * reason, in particular for config parsing. It's not needed anymore @@ -123,7 +123,7 @@ gimp_levels_config_class_init (GimpLevelsConfigClass *klass) "linear", _("Linear"), _("Work on linear RGB (this property is ignored; use \"trc\" instead)"), - FALSE, 0); + TRUE, 0); GIMP_CONFIG_PROP_ENUM (object_class, PROP_CHANNEL, "channel",