Sizing image using gcf
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
M
am 10 Aug. 2016
Beantwortet: Natch Ruengsakulrach
am 31 Aug. 2016
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?
0 Kommentare
Akzeptierte Antwort
Natch Ruengsakulrach
am 31 Aug. 2016
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 Kommentare
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!