Creating an outline around the outer lines of an image

I have the following image, with a transparent background in the spots that look white:

The thing is, I need those parts to be white, not transparent, when I export the image as a PNG. I am trying to essentially create a mask, only with it being completely solid within the outer lines of the mask, and have it be a few pixels wider than the original image (so that there is essentially a border on the image, if that makes sense).

I’m just not sure how to do this. I can create a mask, as seen below (made red for example) but I can’t quite get what I’m looking for. Any tips would be greatly appreciated.