>>2204213A black background is easy. Select all black, expand and feather the mask a bit, then invert it.
Now the black areas and a hairline around them are protected. Flood-fill everything else.
When I did
>>2204209, after I whited-out everything I considered background, I posterized the image to just black and white. Any gray pixels inside the girl vanished.
That left jaggies so I Gaussian blurred it < 1 pixel.