Saving a texture to file after using glCopyTexSubImage2d

How can I save a texture to file after changing it using glCopyTexSubImage2d? I am currently using tk to load the texture from .sgi, but any format would do, .tga or whatever. Do any libraries do this or do I need to write the code myself (argh)?

Thanks

Use glGetTexImage to get the raw texture data, then save that to the file format of your choice using some library, or your own code.