Painting user's product icon

Hi guys,
I’m making tycoon game and I want player to be able to make he’s own logos at size about 16x16.

But how can I make it and then save it as image file format such as .png.

Painting will be done in the UI.

Help will be appreciated!
Thanks

https://docs.unity3d.com/ScriptReference/Texture2D.EncodeToPNG.html