Use an image editor to modify the file so that all pixels that should not be shown have the same colour.
Use a palette. This will allow you to have multiple pixel values that are treated as transparent but this also means you’re limited to only 255 colours.
Loop over all the pixels and overwrite the ones that you don’t want to show with the color key (or don’t use a color key and instead use a surface with an alpha channel and make the pixels fully transparent).