From 30a8edeab568f95dde360dcff5b805be38a28bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Thu, 10 Nov 2016 15:20:16 +0100 Subject: [PATCH] app: treat half precision float the same as single and double .. which is to say encourage use of linear gamma, by making it one fewer step to end up in linear than gamma corrected. --- app/dialogs/convert-precision-dialog.c | 6 ++++-- app/widgets/gimptemplateeditor.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/dialogs/convert-precision-dialog.c b/app/dialogs/convert-precision-dialog.c index 3351d21f00..5029d13824 100644 --- a/app/dialogs/convert-precision-dialog.c +++ b/app/dialogs/convert-precision-dialog.c @@ -127,16 +127,18 @@ convert_precision_dialog_new (GimpImage *image, linear = FALSE; break; + /* leave gamma alone by default when converting to 16/32 bit float */ case GIMP_COMPONENT_TYPE_U16: case GIMP_COMPONENT_TYPE_U32: - case GIMP_COMPONENT_TYPE_HALF: default: linear = gimp_babl_format_get_linear (old_format); break; case GIMP_COMPONENT_TYPE_FLOAT: + case GIMP_COMPONENT_TYPE_HALF: case GIMP_COMPONENT_TYPE_DOUBLE: - /* default to linear when converting to float or double */ + /* default to linear when converting to half, single or double precision + * floating point */ linear = TRUE; break; } diff --git a/app/widgets/gimptemplateeditor.c b/app/widgets/gimptemplateeditor.c index 8df21a978f..85ed57a21c 100644 --- a/app/widgets/gimptemplateeditor.c +++ b/app/widgets/gimptemplateeditor.c @@ -659,12 +659,12 @@ gimp_template_editor_precision_changed (GtkWidget *widget, case GIMP_COMPONENT_TYPE_U16: case GIMP_COMPONENT_TYPE_U32: - case GIMP_COMPONENT_TYPE_HALF: default: /* leave 'linear' alone */ break; case GIMP_COMPONENT_TYPE_FLOAT: + case GIMP_COMPONENT_TYPE_HALF: case GIMP_COMPONENT_TYPE_DOUBLE: /* default to linear when converting to float or double */ g_object_set (private->template,