save an image in a specific resolution with saveas
조회 수: 80 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
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
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.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Printing and Saving에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!