For anybody using MacPorts, there is a port called makeicns that creates the needed .icns files from the command line. Usage is pretty simple (from the command):
makeicns v1.4.10 (284bd686824f)
Usage: makeicns [k1=v1] [k2=v2] ...
Keys and values include:
512: Name of input image for 512x512 variant of icon
256: Name of input image for 256x256 variant of icon
128: Name of input image for 128x128 variant of icon
32: Name of input image for 32x32 variant of icon
16: Name of input image for 16x16 variant of icon
in: Name of input image for all variants not having an explicit name
out: Name of output file, defaults to first nonempty input name,
but with icns extension
align: [center, left, right, top, bottom] {First letter suffices!}
Examples:
makeicns -512 image.png -32 image.png
Creates image.icns with only a 512x512 and a 32x32 variant.
makeicns -in myfile.jpg -32 otherfile.png -out outfile.icns
Creates outfile.icns with sizes 512, 256, 128, and 16 containing data
from myfile.jpg and with size 32 containing data from otherfile.png.