Most of this isn't really necessary. Technically, you can take any image from the clipboard and paste it onto a file/folder/application in the Get Info window. Just draw it up in Photoshop, or whatever other program you like, copy it and paste it in Get Info.
Also, I wonder where you got the 512 x 512 pixel image size? The largest icon size is 128 x 128 pixels. Of course, a 512 x 512 image would scale down, but if you're designing the icon (rather than just pasting some picture), it's better to design at the right size.