function bmp=convert2BMP(img)
%convert an image of 4096 gray levels to an img of 256 gray levels
%input: img is of 4096 gray levels
%output: bmp is of 256 gray levels
img=double(img);
bmp=uint8(floor(img/16));
%imshow(bmp);
%convert an image of 4096 gray levels to an img of 256 gray levels
%input: img is of 4096 gray levels
%output: bmp is of 256 gray levels
img=double(img);
bmp=uint8(floor(img/16));
%imshow(bmp);