Bitmap Pixels


I am working on a Space Invaders game. The main game loop displays a background
image once, and the game sprites are displayed on top of the background. My
Space Invader bases, which are bitmap images, get hit by bullets, and I want to
achieve a chip-away effect when they do, like the original Space Invaders. Does
anyone have any example code or snippets for how this might be achieved? I’m
thinking I need to somehow grab the pixels of the affected area, use
SDL_SetColorKey to make the pixels transparent, then somehow make them part of
the bitmap surface again?

Thanks for your help!