This video walkthrough, complete with voiceover explaining actions, and the reasons behind them takes you from the very beginning, with the source picture:
through the use of a layer mask to cut-out the image, all the way through to the end result of the icon, including all optimization: