This is a suggestion / enhancement, and it might not even fit SDL but SDL_Image instead.
I am pretty sure you know about this kind of antialiasing issues (notice the grey rectangle of a texture rendered in the foreground):
They occur when using SDL_HINT_RENDER_SCALE_QUALITY "linear" or "best".
They occur because transparent pixels are affecting the edges of the non-transparent ones, because those transparent pixels are oftenly are stored by programs as RGBA(0,0,0,0) or RGBA(255,255,255,0), and antialiasing uses those pixels to calculate the smoothing of those edges.
These antialiasing issues are a natural thing to the feature, but they can be easily mitigated by using "alpha bleeding".
Here's a good explanation of Alpha bleeding
So, my proposal/suggestion:
Could SDL apply alpha bleeding to surfaces/textures when loading/converting them?
I currently use this small tool to solve this issue in my PNGs, but could be good if I could apply alpha bleeding directly in SDL, as sometimes I generate new bitmaps in runtime: alpha-bleeding-d
This is a suggestion / enhancement, and it might not even fit SDL but SDL_Image instead.
I am pretty sure you know about this kind of antialiasing issues (notice the grey rectangle of a texture rendered in the foreground):
They occur when using SDL_HINT_RENDER_SCALE_QUALITY "linear" or "best". They occur because transparent pixels are affecting the edges of the non-transparent ones, because those transparent pixels are oftenly are stored by programs as RGBA(0,0,0,0) or RGBA(255,255,255,0), and antialiasing uses those pixels to calculate the smoothing of those edges.
These antialiasing issues are a natural thing to the feature, but they can be easily mitigated by using "alpha bleeding". Here's a good explanation of Alpha bleeding
So, my proposal/suggestion: Could SDL apply alpha bleeding to surfaces/textures when loading/converting them?
I currently use this small tool to solve this issue in my PNGs, but could be good if I could apply alpha bleeding directly in SDL, as sometimes I generate new bitmaps in runtime: alpha-bleeding-d
Here's the code and resources to reproduce the issue: antialiasing_bug.c.txt background.png foreground.png