Creating Outline Of Sprite (2D SS)

How can I create an outline of a sprite when overlapping something?

(In my example, I want the player to swim through lava, but it isn’t transparent, and I want the player to know where they are, so could I create some form of a silhouette of the player when swimming through the lava, without the actual sprite showing? Just the shape of the sprite and a solid color?)