Sizing image using gcf

조회 수: 4 (최근 30일)
M
M 2016년 8월 10일
답변: Natch Ruengsakulrach 2016년 8월 31일
I am trying to set my image to be 912 x 1140 pixels using:
set(gcf,'units','pixels','position',[0 0 912 1140])
However, when I save the .bmp image and check the properties, it says the dimensions are 912 x 821 pixels. Why is this happening / what are other ways for me to do this?

채택된 답변

Natch Ruengsakulrach
Natch Ruengsakulrach 2016년 8월 31일
The command you provided does not resize the image. To resize image, use the “imresize” function. For example,
A = imread(peppers.png); % read the built-in image
resizedA = imresize(A,[1140 912]);
imwrite(resizedPeppers.png); % resizedPeppers.png is now 912 x 1140 pixels

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by