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 Kommentare

Ameer Hamza
Ameer Hamza am 8 Okt. 2020
Which function are you using? Are you saving an image or a figure() window?
Niloufar Baba adam
Niloufar Baba adam am 8 Okt. 2020
I use saveas(gcf,'filename.jpg') in my code
Walter Roberson
Walter Roberson am 8 Okt. 2020
Bearbeitet: Walter Roberson am 8 Okt. 2020
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 am 8 Okt. 2020
thank you so much, it worked.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 8 Okt. 2020

1 Stimme

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.

Weitere Antworten (1)

Image Analyst
Image Analyst am 8 Okt. 2020

0 Stimmen

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

Kategorien

Mehr zu Printing and Saving finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by