How do I quantize the colors for a displayed grayscale image with user-specified gray values?
Show older comments
I am working with grayscale images. I would like to quantize the colors in my image to specific values, say around 15 or 20 values. I would like to know if this is possible with MATLAB.
For example, if my image contains gray values from 0 to 255, I would like to quantize them as follows:
0 - 30 => 0 (black)
31 - 150 => 60 (dark gray)
151 - 200 => 120 (light gray)
201 - 255 => 255 (white)
I would like the method to be general and not restricted to four levels of quantization and I would like the freedom to specify which values I want to quantize at.
Accepted Answer
More Answers (0)
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!