How can you transform a color x3uint8 image to uint8?

I have following color image 1152x2048x3 uint8. Is there any way to transform it to 1152x2048 uint8 while still keeping the colors ?

 Akzeptierte Antwort

Thorsten
Thorsten am 18 Nov. 2014

0 Stimmen

No, because for each pixel 2^(8+8+8) different colors are possible.

Weitere Antworten (1)

Guillaume
Guillaume am 18 Nov. 2014

0 Stimmen

Of course, not! Colour in matlab is defined as a triplet of red, green and blue intensity. Thus, for each pixel you need to store 3 values.
You could store the colour image as a 1152x2048 uint32 where each pixel is red * 2^16 + green * 2^8 + blue, but that would actually use 4/3 more memory and you wouldn't be able to use matlab standard image processing functions, so there's little point.
Why do you want to do that anyway?

Kategorien

Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 18 Nov. 2014

Beantwortet:

am 18 Nov. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by