最近想合成一個gif圖片,很多網站提供的功能要vip,還是matlab簡單些。
之前也有用到過這個功能,單獨再拿出來記錄一下。
matlab代碼如下:
clear all; close all; clc; for i=0:100 A =imread(strcat(num2str(i),'.png')); [I,map]=rgb2ind(A,256); if(i==0) imwrite(I,map,'test.gif','DelayTime',0.04,'LoopCount',Inf) else imwrite(I,map,'test.gif','WriteMode','append','DelayTime',0.04) end end