Hi guys
I have a problem with the image quality, when i save the result as .jpg, the quality is reduced, please help me, how can I solve it ?

댓글 수: 4

Ameer Hamza
Ameer Hamza 2020년 10월 8일
Which function are you using? Are you saving an image or a figure() window?
Niloufar Baba adam
Niloufar Baba adam 2020년 10월 8일
I use saveas(gcf,'filename.jpg') in my code
Walter Roberson
Walter Roberson 2020년 10월 8일
편집: Walter Roberson 2020년 10월 8일
If you use print() instead of saveas(), then you can give a resolution by using a '-r' option. For example,
set(gcf,'PaperPositionMode','auto')
print('YourFileName.jpg','-djpeg','-r0') %corrected
which would print at screen resolution.
Niloufar Baba adam
Niloufar Baba adam 2020년 10월 8일
thank you so much, it worked.

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

 채택된 답변

Walter Roberson
Walter Roberson 2020년 10월 8일

1 개 추천

If you use print() instead of saveas(), then you can give a resolution by using a '-r' option. For example,
set(gcf,'PaperPositionMode','auto')
print('YourFileName.jpg','-djpeg','-r0') %note correction compared to my earlier comment
which would print at screen resolution.

추가 답변 (1개)

Image Analyst
Image Analyst 2020년 10월 8일

0 개 추천

Try using exportgraphics().
Save the file as a PNG format file instead of JPEG to avoid lossy compression artifacts.

카테고리

도움말 센터File Exchange에서 Printing and Saving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by