We present 3 solutions to this problem: mp1sol.m is the solution as required by the MP1 document mp1sol2.m is a solution that DOES NOT conform to the MP1 document but shows how one can use the rgb2gray function mp1sol3.m is a solution that DOES NOT violate the MP1 document but goes beyond what was/is expected of the students for this MP1. A. Official solution : mp1sol.m Idea: (0,0,0) is black, (255,255,255) is white. We are going to convert every pixel to a triplet (X,X,X) where X is either the R or G or B component of that pixel. newpict(:,:,1)=newpict(:,:,3) newpict(:,:,2)=newpict(:,:,3) Use the Blue (layer 3) contribution and make the Red and Green values equal to it. This ways R,G,B values for all pixels are the same as the B values. Alternately you could have used the R or G contributions, as shown below for R. newpict(:,:,3)=newpict(:,:,1) newpict(:,:,2)=newpict(:,:,1) Note that the solution file is mp1sol.m . Your submission should have used a file named MP_1_WXYZ.m where WXYZ are the last 4 digits of your NJIT ID. B. Non-conforming solution : mp1sol2.m As we mentioned in the assignment there is an easy way to solve this problem using rgb2gray. This is done in mp1sol2.m . Note that for a gray (i.e. black-and-white) image, one needs to use imshow to display it. The function image displays a 3-layer image, whereas imshow displays a 1-layer image. You can verify the number of layers in pict and newpict by typing. whos. C. Conforming solution : mp1sol3.m How does rgb2gray work to turn a 3-layered into a 1-layered image? A simple 'implementation' of something close to rgb2gray is the code in mp1sol3.m . You can see there a new form of the zeros function. In newpict every pixel obtains a contribution of both red, green and blue. The weights I use are not mine. I looked them up on the Web. MATLAB's implementation of rgb2gray is more complex. Type type rgb2gray.m to find out how it works!