save an image in a specific resolution with saveas

조회 수: 80 (최근 30일)
Robin Hoja
Robin Hoja 2022년 5월 18일
댓글: Robin Hoja 2022년 5월 19일
Hello there,
iam trying to safe an figure with saveas(figurename, 'filename','png'), but saving reduces the resolution from 7000x5000 to 1688x1176, and i want to keep the resolution of 7000x5000.
I don't know if I'm too stupid or if it's too obvious...it would be great if someone could help me.

채택된 답변

Image Analyst
Image Analyst 2022년 5월 18일
Don't use saveas() unless you want a screenshot. Even if you do you want a screenshot, should use exportgraphics.
If you want to save the actual image (instead of a figure window rendering of it on your screen) then use imwrite.
  댓글 수: 3
Image Analyst
Image Analyst 2022년 5월 18일
You're saving the figure handle. That's just as bad. I didn't say to save the figure (screenshot display). I told you to save the actual image variable that gets displayed. You need to save the image variable with imwrite. On the line above
seg_bin, seg_rgb] = createMask(I);
you have 3 images seg_bin, seg_rgb, and I. Which of those images do you want to save to the drive?
imwrite(seg_bin, 'Mask Image.png'); % The binary image
imwrite(seg_rgb, 'Masked RGB image.png'); % The original image blackened outside of the mask.
imwrite(I, 'Original image.png'); % The image that was thresholded, presumably the original image.
Robin Hoja
Robin Hoja 2022년 5월 19일
Thank you, that worked.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by