If you do need to convert image files between formats, consider using one or more of the software packages written especially for file format conversion. There are many very good tools for format conversion, which are freely available and distributed in source or binary form. We've included many such packages on the CD-ROM. There are also some very good commercial packages available. See the section called "Converting Formats" in Chapter 1, Introduction, for some recommendations.
You should consider writing your own conversion program only if you have very specific conversion needs not satisfied by the many publicly available and commercial applications--for example, to accommodate a proprietary format. If you do decide to write your own converter, you will need to know a bit about what to expect when converting from one format type to another.