You should never create icons directly in contact with the border of their frame, because in many cases an icon can be side by side with other icons, like in a toolbar or a dock-like application. Use a two pixels margin at least between the frame and the icon itself.