how to extract number of colors from an image using matlab

3 views (last 30 days)
how to extract number of colors from an image using matlab

Answers (1)

Jan
Jan on 16 Apr 2015
Edited: Jan on 16 Apr 2015
Assuming that the "image" means a file, and not something on paper:
img = imread('YourImage.jpg');
uni = unique(reshape(img, [], 3), 'rows');
Unfortunately rgb2ind does not help here anymore.

Categories

Find more on Modify Image Colors in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!