Designing Your Own Format

We find it hard to imagine why anyone would think that the world needs another graphics file format. And, in fact, we don't want to give the impression that we're encouraging such behavior. But given the fact that people can and will create new formats, we'd like to leave you with some pointers.

Why Even Consider It?

The truth is that this book does not even begin to include all of the hundreds of more obscure formats, some of which are used only privately and remain inside company walls. Companies wishing the output of their products to remain proprietary will always find a way to make it so and thus will continue to develop new formats.

Designing your own format also will help you avoid trouble should the use of someone else's format one day be restricted through legal action. The use of the GIF file format has recently come under licensing restrictions requiring that a royality fee be paid for software that reads or writes the GIF file format. Payment of this fee has been actively enforced through the threat of legal action both by both the owners of the GIF format and the owners of the Lempel-Ziv-Welch (LZW) compression algorithm used by GIF. Remember that even though many formats appear to be freely and publicly available, very few actually are.

Of course there are functional reasons for designing your own format. You may decide that an appropriate format doesn't yet exist, for instance, and thus feel compelled to create a new one. Reasoning leading to this decision is always suspect, however, and sending yet another format out into the world might even decrease your market share in this era of increasing interoperability and file sharing. The unfortunate reality is that file formats are usually created to support applications after the fact. In the modern world, marketing decisions and speculation about the future evolution of the supporting operating system and hardware platform play large parts in the development of program specifications from the very start. So we urge you to consider designing your application around a set of existing formats, or at least a format model.

But If You Must...

With that said, consider the following guidelines if you persist in designing your own:

One Last Word

Remember that a lot of code is already out there and plenty of libraries are available in source form that may be able to supply your needs. Consider this statement from the FAQ (Frequently Asked Questions list) from the newsgroup on the Internet:

Format documents for TIFF, IFF, BIFF, NFF, OFF, FITS, etc. You almost certainly don't need these. Read the section on free image manipulation software. Get one or more of these packages and look through them. Chances are excellent that the image converter you were going to write is already there.

Copyright © 1996, 1994 O'Reilly & Associates, Inc. All Rights Reserved.

Hosted by uCoz