bitbank2 / PNGdec

Arduino PNG image decoder library
Apache License 2.0
162 stars 25 forks source link

Strange result when decode 8-bit gray+alpha #1

Closed spectrenoir06 closed 2 years ago

spectrenoir06 commented 2 years ago

Hello I can't decode this PNG kapa1.0.png: PNG image data, 25 x 28, 8-bit gray+alpha, non-interlaced https://static-cdn.jtvnw.net/emoticons/v2/25/default/dark/1.0 In PNGDraw(PNGDRAW* pDraw) I use img->png->getLineAsRGB565(pDraw, usPixels, PNG_RGB565_LITTLE_ENDIAN, 0x000000);

https://github.com/spectrenoir06/Twitch_emote_hub75/blob/63f36034d0e02860393104d5d037c6f8720f9df6/src/main.cpp#L139

bitbank2 commented 2 years ago

What output do you get? The code looks ok.

spectrenoir06 commented 2 years ago

IMG_20210830_172143.jpg

bitbank2 commented 2 years ago

20210907_115347 I fixed the issue by adding support for gray+alpha to RGB565 in the getLineAsRGB565() function. I'll do a new release of the library too.