Borrar filtros
Borrar filtros

how to get color map of image before converting it to gray?

2 visualizaciones (últimos 30 días)
Arif Nouman Khan
Arif Nouman Khan el 21 de Feb. de 2016
Respondida: Image Analyst el 21 de Feb. de 2016
i want to convert an image to using rgb2gray for some purpose and then i want back that rgb image the problem is i dont know the way how to store colormap before converting it to gray scale and then apply that colormap later on to get back some what similar rgb if not the exactly the sameone . can any one help me please ? searched it like a day and couldnt find any thing which i understand . if any one know about this thing feel free to write small piece of code please

Respuestas (1)

Image Analyst
Image Analyst el 21 de Feb. de 2016
You can do this
[indexedImage, map] = rgb2ind(rgbImage, numColors);
Then to get back "an" rgb image (though not the original), you can do
rgbImage2 = ind2rgb(indexedImage, map);
The smaller numColors is, the more quantized/posterized the reconstructed RGB image will look.

Categorías

Más información sobre Red en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by