Basically, I'm just looking for a function that writes the icon to disk, with no ztxt block.
There's also a bit of an issue with fcopy()'s documentation, because it doesn't explicitly tell you that you can write DMI files to disc using this function. An explicit icon.Export() function would shore up both issues nicely by having an explicit function meant to write icon files to disc.
icon.Export(filename,format,[icon_state],[dir],[frame])
format options:
DMI - export as a DMI, zTxt block intact
PNG - export as a PNG, with no zTxt block
JPG - export as a JPG
GIF - export as a GIF (flips through each frame of each direction of each icon_state)
When specifying an icon_state, direction, or frame, this will limit the frames that are output as part of the final exported graphic.
Thankfully, a lot of this behavior is already in DM's DMI editor. I just want some code access to this stuff.