How to save an image from imshow() as a .jpeg?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
fiona rozario
il 18 Mar 2017
Risposto: Dariush Ashtiani
il 3 Ott 2018
I am creating an RGB image and displaying using imshow(). Once the image is displayed, if I save the image as .jpeg, it gets a white background to it and the image dimensions change. How can I keep it to its original dimensions? Attached image is what I got when I saved it as a .jpeg file and the dimensions are 240x170. Whereas the original dimensions of the constituting matrices are 100x100.
0 Commenti
Risposta accettata
Walter Roberson
il 18 Mar 2017
Modificato: Walter Roberson
il 18 Mar 2017
Have a look at print(), which pays attention to the figure PaperPosition* properties and to the figure InvertHardcopy property. It also allows a -r resolution option.
However, I would instead recommend using imwrite of the rgb matrix.
Più risposte (1)
Dariush Ashtiani
il 3 Ott 2018
You can use saveas commad. Say
filename='image1'; saveas(gcf,[filename,'.jpg'])
0 Commenti
Vedere anche
Categorie
Scopri di più su Image Processing Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!