Save figure as jpg with 600dpi

25 vues (au cours des 30 derniers jours)
Nikolas Spiliopoulos
Nikolas Spiliopoulos le 4 Sep 2019
Commenté : Walter Roberson le 10 Nov 2024 à 20:03
Hi all,
I am trying to save some figures through coding, in jpg format and 600dpi.
Hovewer I have tried these, but still getting error (Matlab version 2019a)
saveas('figure.jpg')
print(gcf,'figure.jpg','-jpg','-r600');
thanks in advance
  1 commentaire
Jan
Jan le 4 Sep 2019
Whenever you mention an error in the forum, post a copy of the complete message.

Connectez-vous pour commenter.

Réponse acceptée

Jan
Jan le 4 Sep 2019
Modifié(e) : Jan le 4 Sep 2019
saveas('figure.jpg')
The first input must be the handle of a figure.
print(gcf, 'figure.jpg', '-jpg', '-r600');
There is no '-jpeg' option for the print command. Do you mean '-djpeg' ?
  5 commentaires
DGM
DGM le 10 Nov 2024 à 19:47
There is no '-djpg' device option. The option for JPG is '-djpeg'.
Walter Roberson
Walter Roberson le 10 Nov 2024 à 20:03
The "-d" prefix stands for "device". The output is to be sent to the JPG "device"

Connectez-vous pour commenter.

Plus de réponses (1)

Fabio Freschi
Fabio Freschi le 4 Sep 2019
In print command, for jpg images, the flag is '-djpeg'

Catégories

En savoir plus sur App Building dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by