Hi,
I noticed that PNG images with an alpha channel were rendered on a white
background. The attached patch changes the behaviour, so that the PNG
background is set to the background color from the color scheme, i.e.
bgcol from config.h.


Alexis
>From d1f5699332069d1e1339ad1adaf651a92bd15480 Mon Sep 17 00:00:00 2001
From: Alexis Hildebrandt <[email protected]>
Date: Thu, 26 Nov 2015 15:03:25 +0100
Subject: [PATCH 3/4] Use background color from color scheme for PNGs

---
 sent.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sent.c b/sent.c
index d6c2c0b..c9ce374 100644
--- a/sent.c
+++ b/sent.c
@@ -210,7 +210,9 @@ int pngread(Image *img)
                                || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
                        png_set_gray_to_rgb(img->png_ptr);
 
-               png_color_16 my_background = {.red = 0xff, .green = 0xff, .blue 
= 0xff};
+               png_color_16 my_background = {.red = sc->bg.rgb.color.red>>8,
+                                             .green = 
sc->bg.rgb.color.green>>8,
+                                             .blue = sc->bg.rgb.color.blue>>8};
                png_color_16p image_background;
 
                if (png_get_bKGD(img->png_ptr, img->info_ptr, 
&image_background))
-- 
2.6.3

Reply via email to