MAT335 IFS Encoder Usage Instructions

This document provides usage instructions for the programme mat335prog created for Randall Pyke (pyke@math.utoronto.ca) as part of my final project in the course MAT335 in the Spring of 2001.

My programme uses Y. Fisher's quadtree fractal compression algorithm to compress and decompress images. This algorithm works by classifying the domains and ranges of an image into a quadtree structure. This means that we cover the planar region of interest by a square then recursively partition squares (domain blocks) into smaller squares (range blocks) until each square contains a suitably uniform subset of the input. Next, we generate the various affine transformations of the range blocks to the domain blocks. If the specified tolerance is not met, we improve the technique by further subdividing a region in order to get a better match at the cost of encoding speed.

My programme allows for the loading, saving, encoding and decoding of images and has a simple and easy-to-use interface. When the programme is loaded, the window view is drawn in a solid dark-yellow colour; that is, no image is in the window view. At this point, an image must be either loaded or an image must be decoded. Once an image is loaded, it can be encoded or saved. The programme only supports 256x256 greyscale images. While it is possible to apply adaptive partitioning schemes for non-square images, such algorithms are more complicated and computationally expensive.

The following bullets summarise the main features:

Loading images
Saving images
Encoding images
Decoding images
Known Bugs and Limitations

Novice users of Windows programmes ought to read this document from beginning to end in order to familiarise themselves with the programme and its features. More expereinced users, on the other hand, will likely only need to use this document as a reference as many of the interface features are common in Windows applications and are self-explanatory.

Loading Images

To load an image into view click the File menu then choose the "Load new image..." menu item. A dialogue will appear and allow you to choose a PNG (Portable Network Graphics) image file. Once you have selected an image file name, click the "Open" button and the image will appear in the programme window. Once an image is loaded, it can be Saved or Encoded. Note that only 256x256 greyscale images may be loaded; attempting to load images of different resolution will result in an error message. The following images illustrate the process of loading an image:

Choose menu item
(step 1)

Click to enlarge image

Choose file name to load
(step 2)

Click to enlarge image

Image appears in window
(result)

 

Saving Images

Before an image can be saved, one must be loaded into view (see Loading Images for more information).

To save an image, choose the "Save current image..." menu item from the File menu. A dialogue is displayed prompting you for the file name. Enter a file name and press the "Save" button. Often times, it is useful to save decoded images as PNG image files for later viewing (in a web page or document, etc.). Note that if an image is not currently loaded in window, attempting choosing the "Save current image..." menu item results in an error message. The following images illustrate the process of saving an image:

Click to enlarge

Choose menu item
(step 1)

Click to enlarge

Choose file name to save as
(step 2)

 

Encoding Images

Before an image can be encoded, one must be loaded into view (see Loading Images for more information).

To encode an image select the "Encode current image & save..." menu item from the Quadtree menu. A dialogue is displayed prompting you for the RMS tolerance -- the default value of 8.0 usually suffices. Higher tolerances result in smaller compressed images with poorer image quality while low tolerances result in larger compressed images with higher image quality. Specifying a tolerance greater than 50.0 defaults to 50.0 tolerance and values between 2 and 15 are usually adequate -- see the Known Bugs and Limitations section for more information about this. Once you have specified a tolerance, click the "Encode" button. Next, a dialogue prompts you for the file name to save the compressed image as. Specify a file name then press the "Save" button. Once the encoding is complete (it may take a while), a message box displays the compression ratio (and the size of the original and compressed files). Press the "OK" button to return to the programme window. The following images illustrate the process of encoding an image:

Click to enlarge

Choose menu item once an image
is already loaded
(step 1)

Specify a rms tolernace
(step 2)

 

Click to enlarge

Choose file name to save as
(step 3)

 

 

Decoding Images

To decode an image, select the "Decode..." menu item from the Quadtree menu. A dialogue appears prompting you for the CIF file (that is, compressed image file) to load. Choose a file name then press the "Open" button. Next, a dialogue appears prompting you for the decoding parameters. Specify the number of iterations (that is, the number of times each transformation should be executed) and whether image smoothing should be performed. Finally, click the "Decode" button to decode the compressed image file. Once decoding is complete, the image will appear in the programme window. The following images illustrate the process of decoding a compressed image file:

Click to enlarge

Choose menu item
(step 1)

Click to enlarge

Choose compressed image file to open
(step 2)

 

Click to enlarge

Specify decoding options
(step 3)

 

Known Bugs and Limitations

The programme, unfortunately, suffers from a few  well-known bugs in the encoding and decoding modules. The specific nature of these bugs is not explained here. But, if you encounter a crash while using the programme to decode an image the root cause is probably from a corrupt CIF file that itself resulted from a too high tolerance value during encoding. I'm currently investigating this bug and other minor bugs and plan to update the programme web page with an update version soon.

In terms of limitations, the programme does not provide any means of specify a minimum or maximum recursive depth for a quadtree or what type of domain classification to use in the encoding process. These options will be added to the updated release.

 

 

Send questions and comments to Farhad Sadaghiani (g9sada@cdf.utoronto.ca)