High Resolution / Quality .gif

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!

답변 (1개)

Jan
Jan 2015년 2월 17일

0 개 추천

GIF use a lossless compression. Therefore you cannot change the "quality".

댓글 수: 3

Ludwig
Ludwig 2015년 2월 17일
편집: Ludwig 2015년 2월 17일
Hello Jan Simon, thank you for your answer. Do you know how I ca change the size of the frame (the width and the height) and therefore the size of the .gif?
Ludwig
Ludwig 2015년 2월 17일
Like normal:
figure('units','normalized','position',[0.1 0.1 0.2 0.2])
Jan
Jan 2015년 2월 17일
Or when you catch the axes object as in your code, set the axes' position accordingly:
axes('Units', 'pixels', 'Position', [10, 10, 100, 200]);

댓글을 달려면 로그인하십시오.

카테고리

질문:

2015년 2월 17일

댓글:

Jan
2015년 2월 17일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by