Discrete Wavelets with Applications

073e- Quantization Using the Daubechies-4 Filter

Helmut  Knaust - Department of Mathematical Sciences, University of Texas at El Paso, hknaust@utep.edu
10/25/2010. Last edit: 11/02/2023

SetDirectory[NotebookDirectory[]];<<DW.wl;<<DW1.wl
SetDirectory["Images\\Grayscale"];

pic=Import["surfer.png","Data"];

ImagePlot[pic]
ShannonEntropy[pic]

We are applying the D4 transform five times :

p3=D4WLT[pic,5];
TransformPlot[p3,5]
ShannonEntropy[p3]

p3q=Quantize[p3,0.995];
ShannonEntropy[p3q]

We now apply the inverse transform five times to see the resulting image. 
	Note: The next command is NOT contained in the package 'DW.wl'.

?InvD4WLT

picq=Round[InvD4WLT[p3q,5]];
ImagePlot[picq,Scaled->True]

The original photo for comparison:

ImagePlot[pic]

PSNR[pic,picq]

Here is a plot of the difference between the original image and its quantized version (negative) :

ImagePlot[255-Abs[pic-picq],Scaled->False]