MATLAB Answers


How to Read animated gif Perfectly

Asked by Frank
on 16 Aug 2014
Latest activity Commented on by Frank
on 16 Aug 2014

when i use the code like [imgs,map]=imread('xx.gif','frames','all'); and then show it with imshow(imgs(:,:,:,1),map); there are stains on the frame of the gif, I think it may because the GIF disposalMethod is leaveinplace.

How to deal with it? thx


Yes, I still saw the streaks,Matlab Version 7.11 2010b,Operating system: Windows 7, Does it matter?

I'm not sure. I'm running 2014a on a Mac, and do not see any streaks in any frame. How did you generate the animation? Through MATLAB?

Frank - since the last set of code showed the streaks, could you attach one or more of the images as mat files along with the map? Just change the code to

 for k=1:7
     [img,map] = imread('2to1.gif','frames',k);

and return one or more of the imgX.mat and the map.mat files. Just curious as to what the contents of these files are. Do they include the streaks/stains?

There's no difference among the methods you suggested. I will try update the matlab. thank you anyway. ^_^

Log in to comment.

0 Answers

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!