문제

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?

도움이 되었습니까?

해결책

Use ind2rgb:

im = ind2rgb(gifim, map);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top