How can I save the output figure into an image file?

7 vues (au cours des 30 derniers jours)
Gulfam Saju
Gulfam Saju le 14 Mar 2022
Commenté : Gulfam Saju le 15 Mar 2022
recon_img = senserecon(aliased_img, sen_map,reduc, fi_matrix);
figure;imshow(abs(recon_img),[0 0.000005]);title('sense recon');
After this line of code the output image shows. Now, I want to export this output figure into another image file.

Réponse acceptée

yanqi liu
yanqi liu le 15 Mar 2022
recon_img = senserecon(aliased_img, sen_map,reduc, fi_matrix);
figure;imshow(abs(recon_img),[0 0.000005]);title('sense recon');
print(gcf,'-dpng','-r200','sense_recon')
  1 commentaire
Gulfam Saju
Gulfam Saju le 15 Mar 2022
The image saves with the title. Is there any way to remove the title? and there are several iterations in the program. So, there are multiple output images? How can I save all using a loop?

Connectez-vous pour commenter.

Plus de réponses (1)

Scott MacKenzie
Scott MacKenzie le 14 Mar 2022
Modifié(e) : Scott MacKenzie le 14 Mar 2022
A easy way is to use exportgraphics, introduced in R2020a:
f = figure;
imshow(...);
exportgraphics(f, 'filename.jpg'); % or .png or whatever format you want (see documentation)

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by