diff --git a/examples/cwebp.c b/examples/cwebp.c index ef903284..e560f881 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -382,7 +382,8 @@ static int ReadPNG(FILE* in_file, WebPPicture* const pic, int keep_alpha) { png_set_strip_16(png); png_set_packing(png); if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png); - if (color_type == PNG_COLOR_TYPE_GRAY) { + if (color_type == PNG_COLOR_TYPE_GRAY || + color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { if (bit_depth < 8) { png_set_expand_gray_1_2_4_to_8(png); }