Make a new layer above the avatar, pick white as primary colour and right click > stroke > 2px.
New layer > Select > Modify > Contract > 1px. Now, use the rectangle selection tool and hold down alt and select 1px in on the straight parts. Select > Inverse. Right click > Fill > Pattern > The one you created; the checks. Now, hold ctrl and click the picture of the avatar, make sure the pattern layer is clicked Select > Inverse and click delete. If you want to change the colour of the blacks, select your colour make a new layer above the pattern and paint bucked fill your colour. Change the mode to “Lighten” and right click the layer and click create clipping mask.