**Name**

**fezw** Compress an image with EZW algorithm

**Command Synopsis**

**fezw** [-r *NLevel*] [-e *EdgeIR*] [-b *ImpulseResponse2*] [-n *FilterNorm*] [-w *WeightFac*] [-d] [-R *TargetRate*] [-P *TargetPSNR*] [-s *SelectArea*] [-o *Compress*] *Image* *ImpulseResponse* [*Qimage* ]

-rNLevel: Number of level for wavelet tranform

-eEdgeIR: Impulse reponses of edge and preconditionning filters for orthogonal transform (fimage)

-bImpulseResponse2: Impulse response of filter 2 for biorthogonal transform (fsignal)

-nFilterNorm: Normalization mode for filter bank

-wWeightFac: Scaling factor for wavelet coefficients

-d : Computes distorsion-rate function

-RTargetRate: Target Rate

-PTargetPSNR: Target PSNR

-sSelectArea: Polygonal regions to be encoded with a different rate or PSNR (Polygons)

-oCompress: Output compressed Image (cimage)

Image: Input image (fimage)

ImpulseResponse: Impulse response of inner filters (fsignal)

Qimage: Output quantized image (fimage)

**Function Summary**

void fezw (NumRec , Edge_Ri , Ri2 , FilterNorm , WeightFac , DistRate , Rate , PSNR , SelectedArea , Output , Image , Ri , QImage , PtrDRC )

int *NumRec ;

Fimage Edge_Ri ;

Fsignal Ri2 ;

int *FilterNorm ;

float *WeightFac ;

int *DistRate ;

float *Rate ;

float *PSNR ;

Polygons SelectedArea ;

Cimage Output ;

Fimage Image ;

Fsignal Ri ;

Fimage QImage ;

char *PtrDRC ;

**Description**

This module compresses a floating point image contained in file Image using Shapiro's EZW algorithm [Sha93] applied to its orthogonal/biorthogonal wavelet transform.

A wavelet transform is first applied to the image. If the -b option is
selected, then a biorthogonal transform is applied using the filter pair
contained in *ImpulseResponse* and *ImpulseResponse2*.
The edge processing is made by reflecting the image across the edges.
If the -b option is not selected, then an orthogonal transform
is performed using the filter contained in *ImpulseResponse* and,
if the -e option is selected, the special filters for edge processing
contained in *EdgeIR* (only for Daubechies wavelets).
If neither the -e and -b options are selected, then an orthogonal transform
is performed with periodization of the image.

The -n option enables to control the filters normalisation. It has the same
effect as in *owave1* (if an orthogonal transform is performed) or
*biowave1* (if a biorthogonal transform is performed) modules.

The -r option specifies the number of level of wavelet transform (NLevel must be a positive integer).

After the wavelet transform has been computed, it is compressed
with the EZW algorithm [Sha93].
It generates both a compressed representation,
which is stored in *Compress* (if the -o option is selected) and
a quantized wavelet transform, which can be reconstructed with
the data contained in *Compress*. A inverse wavelet transform is then
applied to the quantized wavelet transform in order to obtain the quantized
image which is stored in *Qimage* (if selected). This is the image
which can be reconstructed by applying the decompression module *fiezw*
to *Compress*.

The -w, -d, -R, -P and -s options have the same effect
as in *ezw* module.

**See Also**

`biowave2`, `ezw`, `fmse`, `ibiowave2`, `iowave2`, `owave2`.

**Version 1.32**

Last Modification date : Tue Feb 5 17:44:27 2002

**Author**

Jean-Pierre D'Ales