Introduction - If you have any usage issues, please Google them yourself
Reducing the Number of Gray Levels in an Image
(a) Write a computer program capable of reducing the number of gray levels in an image 256 to 2, in integer(整数) powers of 2. The desired number of gray levels needs to be a variable input to your program.
(b) Download Fig. 2.21(a) and duplicate the results shown in Fig. 2.21 of the book.