SDL_image icon indicating copy to clipboard operation
SDL_image copied to clipboard

Restore support for lodepng?

Open ccawley2011 opened this issue 2 years ago • 3 comments

This was supported very briefly in 2019 (added in commit d3d2b9635fee99e23a79305959da66eb657329c0, removed in commit ef2488c0ffb8972f8afc67ef500ba39c49b3d9ee). Since SDL_image now prefers using single header libraries, and stb_image lacks support for palette output (see #298), it might be worth restoring lodepng support and using it instead of stb_image and miniz.

ccawley2011 avatar Sep 07 '22 14:09 ccawley2011

Are there any downsides to using lodepng instead of stb_image for PNG support? Would it be easier to just modify stb_image to support palettes?

slouken avatar Sep 07 '22 15:09 slouken

The only downside of lodepng I can think of compared to stb_image is that it doesn't support decoding from a SDL_RWops stream, so it's necessary to load the whole file into memory before decoding it. I don't know which would be the harder task between extending lodepng to support streams or extending stb_image to support palette output.

ccawley2011 avatar Sep 07 '22 15:09 ccawley2011

If this is only about png palette support of #298, there was a rejected PR draft at stb for it: https://github.com/nothings/stb/pull/788 I don't think that it applies directly today (haven't even tried myself) but maybe wort a look.

(Also possibly related: https://github.com/nothings/stb/pull/45)

sezero avatar Sep 07 '22 16:09 sezero