Frage

When I read a color JPEG image:

jpgim = imread('path/to/image.jpg')

I get an MxNx3 array. However, with GIF files I also need to read the colormap:

[gifim, map] = imread('path/to/image2.gif')

Let's assume that I need only the first frame if the GIF image is animated: gifim = gifim(:,:,:,1) Is there a way to get a standard MxNx3 image array using gifim and map as that is what later parts of my processing pipeline expect?

War es hilfreich?

Lösung

Use ind2rgb:

im = ind2rgb(gifim, map);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top