I’m currently facing an issue with downscaling very large images using SDL2 and SDL_Image. I’ve set SDL_HINT_RENDER_SCALE_QUALITY to linear, but the results are not satisfactory. I’m wondering if it’s possible to achieve better downscaling purely with SDL_Image and SDL2. Could someone please guide me on the correct approach and provide some code snippets if possible? Your assistance is highly appreciated!
I think this is an inherent problem with bilinear interpolation. It’s simply not good at downscaling to much smaller sizes because there are a lot of pixels that gets ignored and doesn’t contribute to the result. You might find this discussion interesting.
To address this issue, I’ve implemented a solution using the stb_image_resize. Prior to creating the texture, I utilized the stbir_resize_uint8_linear function. This involved passing the original surface pixels as the source and the resized surface as the destination, resulting in a more refined image quality.