[gimp/gimp-2-10] app: do not snap white/black when making 2 color palette
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: do not snap white/black when making 2 color palette
- Date: Fri, 1 May 2020 15:37:25 +0000 (UTC)
commit a0f03c0e3750825cf2188fcf387e96f8e52e0371
Author: Øyvind Kolås <pippin gimp org>
Date: Fri May 1 17:35:50 2020 +0200
app: do not snap white/black when making 2 color palette
For such needs there is a dedicated 1bit black/white palette in the
dialog.
(cherry picked from commit 80664c8e6e3081b71ee80b0d01ee8cd157b9fb27)
app/core/gimpimage-convert-indexed.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimpimage-convert-indexed.c b/app/core/gimpimage-convert-indexed.c
index 1cc5efd261..ab1457ae14 100644
--- a/app/core/gimpimage-convert-indexed.c
+++ b/app/core/gimpimage-convert-indexed.c
@@ -2812,13 +2812,17 @@ snap_to_black_and_white (QuantizeObj *quantobj)
}
}
- if (had_white && white_dist < POW2(32))
+ if (desired > 2 &&
+ had_white &&
+ white_dist < POW2(128))
{
quantobj->cmap[whitest].red =
quantobj->cmap[whitest].green =
quantobj->cmap[whitest].blue = 255;
}
- if (had_black && black_dist < POW2(32))
+ if (desired > 2 &&
+ had_black &&
+ black_dist < POW2(128))
{
quantobj->cmap[blackest].red =
quantobj->cmap[blackest].green =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]