MATLAB: Quantize a greyscale Image by 5 levels

image processingImage Processing Toolboxquantize

I would like to quantize an image by 5 levels without using the imquantize command. Given any a grayscale image on a scale of [0,255] this should be possible. Thanks in advance for your time and help.

Best Answer

Q = floor(YourArray ./ (256/5));
Related Question