From 56d207e98da7f8edb52a43c58c070961aadee65b Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Thu, 14 Nov 2024 11:33:14 +0000 Subject: [PATCH] plug-ins: Fix color format for Smooth Palette... ...when drawable has alpha channel. We always created GeglSamplers in RGB format, but used the original drawable's format to create a GeglBuffer. If the original drawable had an alpha channel, this caused "glitchy" results since not enough data would be copied into the new buffer. This patch resolves the issue by making the format match the original drawable's number of channels. Resolves Issue #12362. --- plug-ins/common/smooth-palette.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plug-ins/common/smooth-palette.c b/plug-ins/common/smooth-palette.c index 9605de28c7..77c6b24b74 100644 --- a/plug-ins/common/smooth-palette.c +++ b/plug-ins/common/smooth-palette.c @@ -282,7 +282,8 @@ smooth_palette (GimpProcedureConfig *config, gfloat *pal; GRand *gr; - const Babl *format = babl_format ("RGB float"); + const Babl *format = gimp_drawable_has_alpha (drawable) ? + babl_format ("RGBA float") : babl_format ("RGB float"); g_object_get (config, "width", &config_width,