When I create a masked image (blue) with a rounded rect, with the same rect as the background (red), the background shows through the corners of the masked image (see attached). How can I make it so no pixels show through?
Based on the example image I think that I would do this with Clipping mask.
You could do something like:
Tip: I sometimes make Shape layer and then put a texture layer ( that fills the whole document ) into clipping mask with the Shape layer, that way I can resize the shape layer if needed and the texture just sits there and wont get disturbed.
You could use a Clipping Mask, or a Group Mask, or even two paths, provided they were positioned with no overlap (the red area could be square finished, the blue area could have rounded corners on the bottom only).
Everything you need to know about vector masking in Photoshop can be found here:
I'd choose your approach based on what else you want to do with the shapes, and how you may edit them in the future.
Clipping Masks are brilliant though. Definitely one of Photoshop's best features.