SDL_image PNG surfaces showing up as black

I have a strange bug with my program, where x ( a green x ) and o ( a red o ), both solid color PNG images with a transparent background, get drawn to the screen completely black. The non-transparent shape remains the same.

The code where the images are loaded:

x = IMG_Load( “x.png” );
o = IMG_Load( “o.png” );

The code where the images are drawn to the main window surface:

case SQUARE_X:
SDL_BlitSurface( x, NULL, surface, &board[i][j] );
break;
case SQUARE_O:
SDL_BlitSurface( o, NULL, surface, &board[i][j] );

I don’t have a good idea what might be causing this.

After I edited my background image (adding yellow text) the O’s now get drawn with the same color as the text. The X’s remain black.

SOLVED: my background image was an 8-bit PNG instead of a 32-bit one.