I've looked all over for this but nobody seems to have posted a working answer: How can I make an eraser for a drawing made using CGContext? I can't just draw the background color over the drawing because I need the background to remain transparent. People have suggested using transparent paint, but that won't work. I need to replace what's drawn with transparent paint. Thanks.