From 005f8d3797a844c892e53d71cd5ae8855dc4bed6 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Wed, 6 Sep 2023 11:37:16 +0200 Subject: convert grayscale templates to RGB --- src/image.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/image.c b/src/image.c index dd52b95..d93ee5f 100644 --- a/src/image.c +++ b/src/image.c @@ -1,3 +1,5 @@ +#include + #include "image.h" #include "common.h" @@ -28,7 +30,14 @@ unsigned decode32(uint32_t** out, unsigned* w, unsigned* h, png_byte color_type = png_get_color_type(png, info); if(color_type == PNG_COLOR_TYPE_PALETTE) + { png_set_palette_to_rgb(png); + } + else if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA + || color_type == PNG_COLOR_TYPE_GRAY) + { + png_set_gray_to_rgb(png); + } if(png_get_valid(png, info, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png); -- cgit v1.2.3