SDL_image icon indicating copy to clipboard operation
SDL_image copied to clipboard

can't get a palette from a png 8 bit format in 2.6.2

Open zelurker opened this issue 2 years ago • 3 comments

Until now I used IMG_Load to get an SDL_Surface with a palette and then did a color cycling with that on a specific 8 bit png. Now the returned SDL_Surface is converted to true color without any way to change that ! Should I just drop SDL_image for this then ? (I am not 100% certain the change occurred in 2.6.2 but it's recent for sure).

zelurker avatar Sep 03 '22 11:09 zelurker

PNG files with palettes are currently only supported with libpng - stb_image only supports returning true colour or greyscale images. As a workaround, you can disable stb_image by building with --enable-stb-image using autotools or -DSDL2IMAGE_BACKEND_STB=OFF using CMake.

ccawley2011 avatar Sep 07 '22 14:09 ccawley2011

Too bad if sdl2_image is a binary package from a distribution where you can't choose if you want to use this or not... Anyway thanks for the info

zelurker avatar Sep 07 '22 14:09 zelurker

We have this regression with pygame as well. Since we're using the windows binaries from SDL, and because there are hundreds of other distros of SDL configured differently and we don't get to control how they are compiled.

illume avatar Sep 15 '22 17:09 illume