High Resolution / Quality .gif
5 views (last 30 days)
Show older comments
Dear all,
I want to change the resolution of my .gif. Creating the .gif is no problem, here is an code example (source: http://stackoverflow.com/questions/11051307/approaches-to-create-a-video-in-matlab):
%# figure
figure, set(gcf, 'Color','white')
Z = peaks; surf(Z); axis tight
set(gca, 'nextplot','replacechildren', 'Visible','off');
%# preallocate
nFrames = 20;
f = getframe(gca);
[f,map] = rgb2ind(f.cdata, 256, 'nodither');
mov = repmat(f, [1 1 1 nFrames]);
%# create movie
for k=1:nFrames
surf(sin(2*pi*k/20)*Z, Z)
f = getframe(gca);
mov(:,:,1,k) = rgb2ind(f.cdata, map, 'nodither');
end
close(gcf)
%# create GIF and open
imwrite(mov, map, 'myPeaks4.gif', 'DelayTime',0, 'LoopCount',inf)
winopen('myPeaks4.gif')
But how to change the quality of the .gif? Thanks a lot!
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!