Problem #3


I used the same grayscale image as in Problem #1, cameraman.tif. I used the same color image as in Problem #2, santosa.jpg.

Part a.
First we quantized the grayscale image to 4 bits using uniform thresholding.

Then we quantized each color plane of santosa.jpg to 4 bits using thresholding.
Original 8 Bit R Original 8 Bit G Original 8 Bit B
4 Bit R 4 Bit G 4 Bit B
When we combine all 3 color planes, we get the following 4 bit color image.

Source Code: hw3_a.m

Part b.
First we quantized the grayscale image to 4 bits using Floyd-Steinberg.

Then we quantized each color plane of santosa.jpg to 4 bits using Floyd-Steinberg.
Original 8 Bit R Original 8 Bit G Original 8 Bit B
4 Bit R 4 Bit G 4 Bit B
When we combine all 3 color planes, we get the following 4 bit color image.

Source Code: hw3_b.m


Note: In both 4 bit quantization schemes, I mapped to 2^4=16 discrete values in the range [0,255]. We could just as easily have mapped to the integers 0,1,...,15 if so desired. This could be done as a post-processing step. But I chose the [0,255] range purely for drawing purposes. This allows us to use the imshow command in MATLAB without a re-mapping to [0,255].
Back to HW 1 Page.