You already have lots of examples in the SDK.
For JPG, BMP, or PNG you should just use Photoshop to save.
For other formats, you could write a format plugin, or an export plugin.
If you know C, it should take you 10 minutes or less to modify one of the example plugins.