libsdl-org/SDL_image

Restore support for lodepng?

ccawley2011 opened this issue · 3 comments

This was supported very briefly in 2019 (added in commit d3d2b96, removed in commit ef2488c). 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.

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?

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.

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

(Also possibly related: nothings/stb#45)