FIF2: why a new open format
FIF2 is a new file format for fractal images, published with a complete specification and a reference implementation in source code. It uses the method of the 1990s formats and solves the problems that made them hard to use.
The problem
Fractal image compression has properties that no mainstream format offers: pictures that can be decoded at a higher resolution, and files whose every beginning is a complete picture. In the 1990s these properties were available only in closed, patented formats controlled by one company. When the company stopped developing them, the formats were no longer supported. Files from that time are now difficult to open, and other developers could not use the technology without a licence.
The patents of that period have expired, and computers are fast enough that encoding takes seconds instead of hours. FIF2 provides a format that anyone may read, write and extend.
What “open” means for FIF2
- The specification is public. It describes every byte of a file in enough detail to write an independent decoder without looking at the reference code.
- The reference implementation is published. The encoder, decoder and command-line tool are available as source code. They serve as the definitive example of correct behaviour.
- The format can grow without breaking. Files carry a version number, and new information goes into named entries that older readers skip. Within a major version, a reader built today will still decode the picture in a file written by a later minor version.
What FIF2 does differently
| Legacy FIF | FIF2 |
|---|---|
| No published description | Complete public specification |
| Fixed block size and constants per profile | Block sizes from 2 to 256 pixels, chosen per picture; all coding parameters stored in the file |
| Some files depend on external templates | Every file is self-contained |
| No checksums | Checksums for the header, every metadata entry and every section; damage is detected and stays local |
| Metadata limited to a few fixed fields | Any number of named metadata entries: author, copyright, colour information, encoder settings, decoder recommendations |
| Progressive only in one variant | Every file is progressive: any beginning of the file decodes to a complete picture |
| — | Optional JPEG preview image, readable without a fractal decoder |
| Attached sound only | Any original file can be attached, for example a camera raw file |
What FIF2 keeps
FIF2 keeps the techniques of the old formats that still bring a benefit:
- The block-based fractal method itself, with range blocks copied from larger domain blocks under eight orientations.
- Separate colour planes in the YCbCr colour space, optionally at reduced resolution.
- Tiles that can be decoded independently.
- Attached files, generalised from sound recordings to any file.
Two techniques were left out. Shared transformations for groups of blocks were tested during the development of FIF2 and did not improve the result. External templates contradict the goal that every file can be decoded on its own.
Name, extension and media type
FIF2 files use the extension .fif2 and the media type
image/fif2. The distinct extension keeps them apart from legacy
.fif files, which existing programs may try to open with software
that cannot read the new format. Inside the file, the first four bytes are the
ASCII characters FIF2.